Sign in

username:

password:



Not a member?

Search matlab



Search tips

Subscribe to matlab



matlab by Keywords

Atanh | Autocorrelation | Bandpass Filter | C++ | Conv | Database | Deconv | Excel | FFT | Filter | Filtering | FIR | Fourier Transfrom | FSK | Gaussian Noise | Haykin | IFFT | Image | Java | LFSR | LMS | LPC | MEX | OFDM | QPSK | Radix | Random | Sampling | Segmentation | Simulink | Visual Basic | Waveform | Wavelet

Discussion Groups

Discussion Groups | Matlab DSP | ploting frequncy information of a sin wave

Technical discussion about Matlab and issues related to Digital Signal Processing.

  

Post a new Thread

ploting frequncy information of a sin wave - joshy jose - Jan 23 9:04:56 2007



hai friends,

 i was just trying to use inbuilt function fft(x,n) to find out the
frequency information of a sin wave and tried to plot it

 i took
n=0:.003:2
x=a*sin(2*pi*50*n)
y=fft(x,1024)
stem(y);
-- 

i could't get any correct wave form , ic peak at 50 hz

how can this be done
i intension is to demonstrate the windowing and taking FFT of long sequencs
signal

regards,
                  Joshy m. Jose
                   kerala , India
                   91-9447976001



(You need to be a member of matlab -- send a blank email to matlab-subscribe@yahoogroups.com )

Re: ploting frequncy information of a sin wave - Amit Pathania - Jan 24 8:56:47 2007

Since you are using 'stem' without any time index you should be getting a graph with 2
peaks at some positie value. try to use a frequency index of -fs/2:1/1024:fs/2 - 1 in your
stem() function as so
   
  stem(-fs/2:1/1024:fs/2 - 1,y). Incase you are wondering about fs, its equal to 1/Ts where Ts
is 0.003. Hope this helps

joshy jose <j...@gmail.com> wrote:
            hai friends,
   
   i was just trying to use inbuilt function fft(x,n) to find out the frequency information of
a sin wave and tried to plot it
   
   i took 
  n=0:.003:2
  x=a*sin(2*pi*50*n)
  y=fft(x,1024)
  stem(y);
-- 
   
  i could't get any correct wave form , ic peak at 50 hz
   
  how can this be done
  i intension is to demonstrate the windowing and taking FFT of long sequencs signal
  
regards,
                  Joshy m. Jose
                   kerala , India
                   91-9447976001

Amit Pathania



(You need to be a member of matlab -- send a blank email to matlab-subscribe@yahoogroups.com )