Continue to Site

Welcome to

Welcome to our site! 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?

Not open for further replies.


Member level 2
Jan 13, 2003
Reaction score
Trophy points
Activity points

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

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:
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...

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

Not open for further replies.

Part and Inventory Search

Welcome to