Continue to Site

# How to get the amplitude spectrum of a sine wave?

Status
Not open for further replies.

#### bunalmis

##### Full Member level 5
sine wave spectrum

Pure sine wave has not any harmonic.

Oluwole_Oyetoke

### Oluwole_Oyetoke

Points: 2

#### diegolinder

##### Member level 3
amplitude spectrum of sine

you can use the fft (fast fourier transform). If you matlab, use fft function and ifft function.

Oluwole_Oyetoke

### Oluwole_Oyetoke

Points: 2

#### psi

##### Member level 2
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?

Oluwole_Oyetoke

### Oluwole_Oyetoke

Points: 2

#### tahiti

##### Junior Member level 2
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.

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

Oluwole_Oyetoke

### Oluwole_Oyetoke

Points: 2

#### mickeymouse

##### Member level 1
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))

Oluwole_Oyetoke

### Oluwole_Oyetoke

Points: 2

#### psi

##### Member level 2
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!

Oluwole_Oyetoke

### Oluwole_Oyetoke

Points: 2

#### mickeymouse

##### Member level 1
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)

Oluwole_Oyetoke

### Oluwole_Oyetoke

Points: 2

#### Oluwole_Oyetoke

##### Junior Member level 3
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.