This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
vpde_lecture34 [2020/04/21 08:42] trinh |
vpde_lecture34 [2020/04/23 08:16] (current) trinh |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Lecture 34: The maths of music I ====== | ====== Lecture 34: The maths of music I ====== | ||
| + | |||
| + | < | ||
| + | <iframe width=" | ||
| + | </ | ||
| ===== The Fourier spectra ===== | ===== The Fourier spectra ===== | ||
| Line 50: | Line 54: | ||
| < | < | ||
| - | N = length(f2); | + | N = length(f); |
| - | yhat = fft(f2); | + | yhat = fft(f); |
| A = abs(yhat)/ | A = abs(yhat)/ | ||
| K = (Fs/ | K = (Fs/ | ||
| A = A(1: | A = A(1: | ||
| + | plot(K, A) | ||
| </ | </ | ||
| + | |||
| + | (We noticed during the lecture that the above code is flawed by 1 element, as it indicates a peak frequency of 441Hz instead of 440Hz! I believe this is because you have to ' | ||