Hello ,i am trying to show frequency domain transform of 3 sinuos signal.I samples it twice the frequency of the highest frequency in the signal.
Althogh i get 3 harmonics but i dont get them at the 10,30,70 Hz and their amplitude is not 10(As shown in the code bello)
Where did i go wrong?
Thanks.
t=0:0.001:1
f1=10;
f2=30;
f3=70;
y1=10*sin(2*pi*f1*t);
y2=10*sin(2*pi*f2*t);
y3=10*sin(2*pi*f3*t);
y4=y1+y2+y3;
% twice the sampling rate
Fs=2*70;
Ts=1/Fs;
Tn=0:Ts:1;
fft_L=length(Tn);
y4_samples=10*sin(2*pi*f1*Tn)+10*sin(2*pi*f2*Tn)+10*sin(2*pi*f3*Tn);
%stem(Tn_new,y4_samples);
ff=fft(y4,fft_L);
plot(abs(ff));

 채택된 답변

Ameer Hamza
Ameer Hamza 2020년 4월 1일
편집: Ameer Hamza 2020년 4월 1일

0 개 추천

First, you are taking fft of y4 which is sampled at 1000Hz. Check the following code to see how it can be dome properly
f1=10;
f2=30;
f3=70;
% twice the sampling rate
Fs=2.05*70; % sampling frequency is a bit above 2 times to get all the peaks.
Ts=1/Fs;
Tn=0:Ts:1;
fft_L=length(Tn);
y4_samples=10*sin(2*pi*f1*Tn)+10*sin(2*pi*f2*Tn)+10*sin(2*pi*f3*Tn);
%stem(Tn_new,y4_samples);
ff=fft(y4_samples);
ff1 = abs(ff/fft_L);
fft2 = ff1(1:floor(fft_L/2)+1);
f = Fs*(0:fft_L/2)/fft_L;
plot(f, fft2);

댓글 수: 5

fima v
fima v 2020년 4월 1일
Hello Ameer ,I am intresting in the property of aliasing, could you please show me by this simple example, by what amount our signal is copy shifted (in the frequency domain) given a certain undersampling?
Thanks.
As an example check this
f1=10;
f2=30;
f3=70;
% twice the sampling rate
Fs=1.5*70; % sampling frequency is a bit above 2 times to get all the peaks.
Ts=1/Fs;
Tn=0:Ts:1;
fft_L=length(Tn);
y4_samples=10*sin(2*pi*f1*Tn)+10*sin(2*pi*f2*Tn)+10*sin(2*pi*f3*Tn);
%stem(Tn_new,y4_samples);
ff=fft(y4_samples);
ff1 = abs(ff/fft_L);
fft2 = ff1(1:floor(fft_L/2)+1);
fft2(2:end) = 2*fft2(2:end);
f = Fs*(0:fft_L/2)/fft_L;
plot(f, fft2);
The sampling frequency is 135 less than the Nyquist frequency for 70 Hz signal. So you will see that it is shifted back by the amount of this new sampling frequency (105-70=35) Hz.
fima v
fima v 2020년 4월 1일
편집: fima v 2020년 4월 1일
Hello Ameer,in aliasing i was looking for a copy of our signal in a different location
our signal+our signal shifted, this just a shift.
coud you please show a shifted copy?as shown in the figure bellow.
Thanks.
Thanks.
Ameer Hamza
Ameer Hamza 2020년 4월 1일
Sorry, I don't have much knowledge about this stuff. Since this question is specifically related to signal to process, I think you will have a better chance of getting an answer on an appropriate forum: https://dsp.stackexchange.com/
fima v
fima v 2020년 4월 2일
Hello Ameer, could please give me a manual to read about the theory of this?
I am struggling to understand how to contol the amplitude of the harmonics in our transform.
Thanks.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Measurements and Spatial Audio에 대해 자세히 알아보기

태그

질문:

2020년 4월 1일

댓글:

2020년 4월 2일

Community Treasure Hunt

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

Start Hunting!

Translated by