trinny
trinny

Reputation: 232

octave fft of sinus function

I need to use FFT function on sinus.

this is my sinus function:

octave:1> t=(0:1/16000:1);
octave:2> A=2;
octave:3> x=A*sin(2*pi*80*t);

this is how I try to make fft:

octave:60> l=length(x);
octave:61> k=fft(x,l);

It makes me triangle lol.. how can I do this properly?

@edit screen, is it good looking fft of sin? can I improve it somehow? enter image description here

@edit2 Can I improve it, so it would look better?

Upvotes: 1

Views: 2664

Answers (1)

Mikhail
Mikhail

Reputation: 8028

Everything looks good from the screen shot.

  1. The magnitude of the FFT of a sine function is two spike like objects. What you are showing is correct.

  2. The FFT is an algorithm that produces a result similar to the continuous Fourier transform, but is different in a few ways. Besides being discrete, Matlab's FFT warps the values. This can be undone with fftshift(k).

Upvotes: 4

Related Questions