Taking the fft of a signal sampled above the Nyquist rate but getting strange results
조회 수: 7 (최근 30일)
이전 댓글 표시
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
답변 (1개)
Matt J
2022년 4월 22일
편집: Matt J
2022년 4월 22일
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
Matt J
2022년 4월 22일
편집: Matt J
2022년 4월 23일
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.
참고 항목
카테고리
Help Center 및 File Exchange에서 Fourier Analysis and Filtering에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!