Taking the fft of a signal sampled above the Nyquist rate but getting strange results

3 views (last 30 days)
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.)

Answers (1)

Matt J
Matt J on 22 Apr 2022
Edited: Matt J on 22 Apr 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 Comments
L'O.G.
L'O.G. on 22 Apr 2022
Thanks for the response. It's the complete signal in the time domain: x(t) = ∑t/tau. I cover the range of all possible constants tau, and I sample above the Nyquist rate which I base on the smallest tau. I thought that should be sufficient. I'm really stumped.
Matt J
Matt J on 22 Apr 2022
Edited: Matt J on 23 Apr 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.

Sign in to comment.

Tags

Products


Release

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!