This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision | |||
|
vpde_lecture34 [2020/04/21 11:25] trinh |
vpde_lecture34 [2020/04/23 08:16] (current) trinh |
||
|---|---|---|---|
| Line 54: | 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 ' | ||