spectral interpolation of the function in matlab
6 views (last 30 days)
Show older comments
Hi,
I wonder if someone can give me example of spectral interpolation of the function.
funtioncs: fft, fftshift, or any other
0 Comments
Answers (1)
Wayne King
on 6 Dec 2011
Hi Feruz, just pad the fft(), that interpolates the DFT.
Fs = 1024;
t = 0:1/Fs:(1000*(1/1024))-(1/1024);
x = cos(2*pi*100*t)+randn(size(t));
xdft = fft(x);
plot(abs(xdft));
% now pad to 1024 to interpolate at 1 Hz spacing
xdft1 = fft(x,1024);
figure;
plot(abs(xdft1));
Look how much narrower the line component shows up in the latter
2 Comments
Greg Heath
on 12 Dec 2011
f is a bad choice for. a function. Use it for frequency.
f is complex. Either make it real or plot ampliitude and phase
Do not plot vs index. Plot f vs time and z vs frequency
Hope this helps.
Greg
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!