Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to get the amplitude spectrum of a sine wave?

Status
Not open for further replies.

psi

Member level 2
Member level 2
Joined
Jan 13, 2003
Messages
42
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,288
Activity points
268

sin wave spectrum

using fft in matlab gives me two spikes on in the negative side and one in the positive side.. the rest is zero in between them. I want to get one spike in the positive side like in the URL I posted.

Is the fourier transform the amplitude spectrum?
 
amplitude spectra, sin wave

i would recommend reading a richard lyonn's book about signal processing, it's very good for a begineer.

basically, first you usually do the filtering to remove higher frequency components (above 2*fs, where fs is sampling frequency). if you don't need (don't want) to remove higher frequencies, you proceed to sampling and then you perform dft of samples.

as somebody said, you get both positive and negative frequency components, because of dft periodicity. for most of purposes, you compute the absolute value of dft result (result * conj(result)), where conj is complex conjunction function.

and you have your spectrum...

for a sine, you should get a peak on frequency-amplitude graph exactly at the frequency of that particular sine. this is ideal case, and you will not get pure peek in practice because of many effects that are far beyond this simple explanation.

hope it helps

tahiti
 
sinewave spectrum

result is ok

if you need only one spike after fft use samples from 1 to half of all samples - if signal is real the rest is a miiror

if you need amplitude you must divide result by half of fft-size

for example (from matlab):
t=2*pi/300:2*pi/300:2*pi; % time samples
x=sin(t); % sine wave, aplmitude 1
y=abs(fft(x))/150; % spectrum, fft-size=300
if you need only main part od spectrum plot if with:
plot(y(1:150))
 
sine wave to spectrum

the matlab program is working fine.. thanks!! So the amplitude spectrum is basicly the amplitude of the fourier transform of the time domain signal...

thanks!
 
absolute value sine wave spectrum

psi said:
So the amplitude spectrum is basicly the amplitude of the fourier transform of the time domain signal...

yes, but remember of scaling factor...

spectrum analyzer sometimes (often?) measures power spectrum, it means square of amplitude of fourier transform (scaled by proper factor)
 
Hello brothers, im having challenges with getting the spike of my sine wave at the right frequency. Pls is there any thing in particular i am meant to consider when computing the FFT of a sine wave
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top