Hi everybody I wrote a simple code in MATLAB to find the FFT of signal ********************************************************** clear all; clc; Fs0; t=[0:100]/Fs; s1=sin(2*pi*5*t); s2=sin(2*pi*10*t); s=(s1+s2); figure(1); plot(t,s) St(s,512); w=(0:255)/256*(Fs/2); figure(2); plot(w,abs([S(1:256)'])) xlabel('FREQUENCY'); Ylabel('Magnitude'); *********************************************************** Now the magnitude of the FFT curve is 50. But the input signal is having amplitude of 1 in both the cases. Then how come during FFT this thing got magnified to 50. Can anybody explain this thing? Sonia |
|
FFT Magnitude doubt
Started by ●May 27, 2003
Reply by ●May 27, 20032003-05-27
On Tuesday 27 May 2003 09:20, Sonia Ramwaswamy wrote: > Hi everybody > > I wrote a simple code in MATLAB to find the FFT of signal > > ********************************************************** > clear all; > clc; > Fs=0; > t==[0:100]/Fs; ^^ The operator == is the equality operator not the assignment operator. Try a single = and you'll be near your goal. > s1==sin(2*pi*5*t); ^^ and so on ... Greets, Andre -- Andre Vehreschild -- Institute for Scientific Computing, Aachen University mailto: , phone: ++49- 241- 80- 24874 GnuPG-key available at http://www.sc.rwth-aachen.de/vehreschild |
Reply by ●May 28, 20032003-05-28
The FFT output depends on the length of the FFT as well as the input amplitude. It also depends on the DFT definition used. For a good text on DFT see http://www-ccrma.stanford.edu/~jos/mdft/ Navan --- Sonia Ramwaswamy <> wrote: > Hi > > Sorry there was some problem with previous mail. Its > not ==== but == only. I dont know hot it got > changed. Any how find below the new piece of code. ********************************************************* > clear all; > clc; > Fs=0; > t==[0:100]/Fs; > s1==sin(2*pi*5*t); > s2==sin(2*pi*10*t); > s==(s1+s2); > figure(1); > plot(t,s) > N=24; > S=t(s,N); > w==((0:((N/2)-1))/(N/2))*(Fs/2); > figure(2); > plot(w,abs([S(1:(N/2))'])) > xlabel('FREQUENCY'); > Ylabel('Magnitude'); > ******************************************************* > > Now the magnitude of the FFT curve is 50. But the > input signal is having amplitude of 1 in both the > cases. Then how come during FFT this thing got > magnified to 50. > Can anybody explain this thing? > > Sonia __________________________________ |
Reply by ●May 30, 20032003-05-30
Hi Sonia I modified your code a bit. I think it will solve your problem. Try it. ____________________________________________________ clear all; clc; Fs0; t=[0:100]/Fs; s1=5*sin(2*pi*5*t); s2*sin(2*pi*10*t); s=(s1+s2); figure(1); plot(t,s) N%60; St(s,N)*(2/Fs); w=((0:((N/2)-1))/(N/2))*(Fs/2); figure(2); plot(w,abs([S(1:(N/2))'])) xlabel('FREQUENCY'); Ylabel('Magnitude'); ____________________________________________ Regards Munish GEMS IT -----Original Message----- From: navaneetha krishnan [mailto:] Sent: Thursday, May 29, 2003 12:47 AM To: ; Subject: Re: [matlab] FFT Magnitude doubt The FFT output depends on the length of the FFT as well as the input amplitude. It also depends on the DFT definition used. For a good text on DFT see http://www-ccrma.stanford.edu/~jos/mdft/ Navan --- Sonia Ramwaswamy <> wrote: > Hi > > Sorry there was some problem with previous mail. Its > not ==== but == only. I dont know hot it got > changed. Any how find below the new piece of code. ********************************************************* > clear all; > clc; > Fs=0; > t==[0:100]/Fs; > s1==sin(2*pi*5*t); > s2==sin(2*pi*10*t); > s==(s1+s2); > figure(1); > plot(t,s) > N=24; > S=yt(s,N); > w==((0:((N/2)-1))/(N/2))*(Fs/2); > figure(2); > plot(w,abs([S(1:(N/2))'])) > xlabel('FREQUENCY'); > Ylabel('Magnitude'); > ******************************************************* > > Now the magnitude of the FFT curve is 50. But the > input signal is having amplitude of 1 in both the > cases. Then how come during FFT this thing got > magnified to 50. > Can anybody explain this thing? > > Sonia __________________________________ _____________________________________ Note: If you do a simple "reply" with your email client, only the author of this message will receive your answer. You need to do a "reply all" if you want your answer to be distributed to the entire group. _____________________________________ About this discussion group: To Join: To Post: To Leave: Archives: http://www.yahoogroups.com/group/matlab More DSP-Related Groups: http://www.dsprelated.com/groups.php3 ">http://docs.yahoo.com/info/terms/ |