Taking the fft of a signal sampled above the Nyquist rate but getting strange results
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I have been trying to reproduce a frequency domain function from a time domain signal, but getting nothing like what I expect.
I am sampling the signal above the Nyquist rate. The dt below is 1e-4. When I reconstruct the signal, it looks like what I expect:
So I think I reconstructed it correctly. Notice that it is on a log-log plot.
I take the FFT by doing the following:
nfft = 2^nextpow2(length(xt));
df = 1/dt;
freq = (df/2)*linspace(0,1,nfft/2+1);
xf = fft(xt,nfft)/length(xt);
And then I get this for the single-sided fft when I type plot(freq,2*xf(1:numel(freq))):
Notice that this also is on a log-log scale. Unfortunately, this is nothing like I expect. It looks like it's been flipped about a horizontal line from what I would expect more or less. I certainly would think that it wouldn't be monotonically decreasing like this.
Have I made any error in my implementation of the fft? More specifically, does any of this make sense conceptually from the trend I see in log-log space for the time domain signal? Is there a good sanity check I can do?
(I realize this is part Matlab question, part fft concepts, but I would appreciate some insight. I'm really stuck.)
0 commentaires
Réponses (1)
Matt J
le 22 Avr 2022
Modifié(e) : Matt J
le 22 Avr 2022
nfft = 2^nextpow2(length(xt));
df = 1/nfft/dt;
freq = df*(0:nfft-1);
xf = abs(fft(xt,nfft))*dt;
half=1:nfft/2;
plot(freq(half),xf(half))
4 commentaires
Matt J
le 22 Avr 2022
Modifié(e) : Matt J
le 23 Avr 2022
Well, x(t) = ∑t/tau is an infinite linear ramp. For one thing, this looks nothing like the signal you have posted. For another, it goes to infinity both at t=inf and t=-inf, so it is not Fourier transformable signal. It therefore has no bandwidth from which you could compute a Nyquist rate.
Voir également
Catégories
En savoir plus sur Spectral Measurements dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!