필터 지우기
필터 지우기

recreating nyquist regions using FFT

조회 수: 12 (최근 30일)
fima v
fima v 2023년 3월 17일
답변: Paul 2023년 3월 18일
Hello,Using code bellowI have sampled a signal and made FFT to see the spectral picture of the time domain signal. the plot bellow shows only 1st and 2nd nyquist zone. I want to expend the spectral image and see the 3rd and 4th nyquist zones.
i have tried to double number of samples but it only expand the previos image two times. where did i go wrong recreating addional nyquist zones? Thanks.
clc
clear all
Fs=200e3;
Ts=1/Fs;
dt=0:Ts:5e-3-Ts;
f1=1e3;
f2=20e3;
f3=30e3;
y=5*sin(2*pi*f1*dt)+5*sin(2*pi*f2*dt)+10*sin(2*pi*f3*dt);
%plot(dt,y)
nfft=length(y);
nfft2=1000;
fy=fft(y,nfft2);
f_half=2*fy(1:(nfft2));
xfft=Fs.*(0:(nfft2)-1)/nfft2;
plot(xfft,abs(f_half)/(nfft));

답변 (1개)

Paul
Paul 2023년 3월 18일
Are the "third" and "fourth" Nyquist zone the frequencies from Fs to 3*Fs/2 and from 3*Fs/2 to 2*Fs respectively? If so, third is just a copy of the first and the fourth is just a copy of the second, because the Discrete Time Fourier Transform is periodic with period Fs. So, if a plot is really desired it's just
clc
clear all
Fs=200e3;
Ts=1/Fs;
dt=0:Ts:5e-3-Ts;
f1=1e3;
f2=20e3;
f3=30e3;
y=5*sin(2*pi*f1*dt)+5*sin(2*pi*f2*dt)+10*sin(2*pi*f3*dt);
%plot(dt,y)
nfft=length(y);
nfft2=1000;
fy=fft(y,nfft2);
Not sure why fy is being multiplied by 2? But we'll keep it ...
f_half=2*fy(1:(nfft2));
f_half = repmat(f_half,1,2);
xfft=Fs.*(0:(numel(f_half))-1)/numel(f_half)*2;
plot(xfft,abs(f_half)/(nfft));

카테고리

Help CenterFile Exchange에서 Discrete Fourier and Cosine Transforms에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by