"Kit Mai" wrote in message <ji45e0$p8d$1@newscl01ah.mathworks.com>...
> hey guys,
>
> I am new in DFT, and I am trying to analysize the distorted signal:
>
> s = sin(2*pi*fd*t+23*pi/180) + 0.25*sin(2*pi*3*fd*t+68*pi/180) + 0.3*sin(2*pi*5*fd*t+16*pi/180) + 0.1*sin(2*pi*128*t+78*pi/180) + 0.15*sin(2*pi*243.2*t+94*pi/180) + 0.07*sin(2*pi*376*t);
>
> fd=60.32Hz;
>
> Sample it using fs=5000Hz, N=1000
>
> I used fft to get the spectrum, the frequency bins are correct, but the values returned from fft in matlab is not correct.
>
> my code is:
> fs = 5000; %Sampling frequency
> T = 1/fs; %Sample time
> N = 1000; %length of signal
>
> fd = 60.32;
>
> t = (0:N1)*T;
> s = sin(2*pi*fd*t+23*pi/180) + 0.25*sin(2*pi*3*fd*t+68*pi/180) + 0.3*sin(2*pi*5*fd*t+16*pi/180) + 0.1*sin(2*pi*128*t+78*pi/180) + 0.15*sin(2*pi*243.2*t+94*pi/180) + 0.07*sin(2*pi*376*t);
> plot(t,s);
>
> Y = fft(s,N); % DFT of sampled sequence
> S = Y*T; % S(w) = T * Y(k)
> f = fs/2*linspace(0,1,N/2+1);
> figure;
> stem(f,2*abs(S(1:N/2+1)));
>
>
> The waveform spectrum shown in the paper is in the following liink:
> http://www.ilovematlab.cn/forum.php?mod=attachment&aid=Nzk4MTJ8OTRlMmI1OGZ8MTMyOTk2MDQxN3w1MjYyNTl8MTYyNzkz¬humb=yes
>
> I am wondering, how can I get the same spectrum as in the paper?
I noticed that the verticalaxis in the spectrum I attached is "amplitude p.u." what does it mean?
For some reason, I need to make the amplitude to be 1 when f=fd, 0.25 when f=3*fd, corresponding to the amplitude in time domain. How can I do this?
I guess the amplitude in this spectrum is not the true value of DFT, am I correct?
If so, then what are the true values of DFT?
Many thanks!
Kit
