Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Fourier Transform Calculation in Matlab

Subject: Fourier Transform Calculation in Matlab

From: nasim .

Date: 8 Feb, 2008 09:09:04

Message: 1 of 5

I have a signal
d(2*pi*t)=actran(2*cost(2*pi*t)-4)+.89
Can some one advise how/if I can do a numerical
calculation for Fourier Transform of this signal in Matlab?

Thank you

Subject: Fourier Transform Calculation in Matlab

From: yuvalif@gmail.com

Date: 8 Feb, 2008 09:22:35

Message: 2 of 5

On Feb 8, 11:09 am, "nasim ." <nasim...@yahoo.com> wrote:
> I have a signal
> d(2*pi*t)=actran(2*cost(2*pi*t)-4)+.89
> Can some one advise how/if I can do a numerical
> calculation for Fourier Transform of this signal in Matlab?
>
> Thank you

in order to do that numerically define a large vector of "t" (with
your desired resolution), create the vector of "d", and perform fft on
"d". Note that you should supply the window size according to the
desired accuracy.
But, if you have the d(t) analytically, why use a numerical
calculation.

Subject: Fourier Transform Calculation in Matlab

From: nasim .

Date: 8 Feb, 2008 10:18:02

Message: 3 of 5

yuvalif@gmail.com wrote in message <aacacfe6-8124-4e49-9700-
02dbbbcea4a9@l32g2000hse.googlegroups.com>...
> On Feb 8, 11:09 am, "nasim ." <nasim...@yahoo.com> wrote:
> > I have a signal
> > d(2*pi*t)=actran(2*cost(2*pi*t)-4)+.89
> > Can some one advise how/if I can do a numerical
> > calculation for Fourier Transform of this signal in
Matlab?
> >
> > Thank you
>
> in order to do that numerically define a large vector
of "t" (with
> your desired resolution), create the vector of "d", and
perform fft on
> "d". Note that you should supply the window size
according to the
> desired accuracy.
> But, if you have the d(t) analytically, why use a
numerical
> calculation.


actually i know the transform is going to be in the form of
d(wt+phi)=s*cos(wt+phi)+d2(wt+phi)
I am trying to find a numerical value for the fourier
series coefficient s.

Subject: Fourier Transform Calculation in Matlab

From: Greg Heath

Date: 8 Feb, 2008 11:21:32

Message: 4 of 5

On Feb 8, 4:09=A0am, "nasim ." <nasim...@yahoo.com> wrote:
> I have a signal
> d(2*pi*t)=3Dactran(2*cost(2*pi*t)-4)+.89
> Can some one advise how/if =A0I can do a numerical
> calculation for Fourier Transform of this signal in Matlab?
>
> Thank you

1. Correct typos?
   a. cost =3D=3D> cos?
   b. actran =3D=3D> atan (arctangent)?
2. Change notation

x =3D atan(2*cos(2*pi*t)-4) + 0.89;

3. FFT assumes the signal starts at t =3D 0
and is periodic (i.e., x(t(+/-)T) =3D x(t) ).
Define two of

a. T - The fft imposed period
b. Fs - The time sampling frequency
c. dt - The time sampling interval
d. N - The number (integer) of samples

consistent with

dt =3D 1/Fs
T =3D N*dt

4. Create vectors t and x

t =3D (0:N-1)*dt; % t =3D 0:dt:T-dt
x =3D atan(2*cos(2*pi*t)-4) + 0.89;

5. plot(t,x)

6. Calculate the frequency sampling interval

df =3D 1/T % df =3D 1/(N*dt) =3D Fs/N

7. Create frequency vector f and transform X

f =3D (0:N-1)*df; % f =3D 0:df:Fs-df
X =3D fft(x);

8. plot(f,abs(X))

Hope this helps.

Greg

Subject: Fourier Transform Calculation in Matlab

From: Greg Heath

Date: 8 Feb, 2008 11:45:48

Message: 5 of 5

On Feb 8, 5:18=A0am, "nasim ." <nasim...@yahoo.com> wrote:
> yuva...@gmail.com wrote in message <aacacfe6-8124-4e49-9700-
>
> 02dbbbcea...@l32g2000hse.googlegroups.com>...
>
> > On Feb 8, 11:09 am, "nasim ." <nasim...@yahoo.com> wrote:
> > > I have a signal
> > > d(2*pi*t)=3Dactran(2*cost(2*pi*t)-4)+.89
> > > Can some one advise how/if =A0I can do a numerical
> > > calculation for Fourier Transform of this signal in
> Matlab?
>
> > > Thank you
>
> > in order to do that numerically define a large vector
> of "t" (with
> > your desired resolution), create the vector of "d", and
> perform fft on
> > "d". Note that you should supply the window size
> according to the
> > desired accuracy.
> > But, if you have the d(t) analytically, why use a
> numerical
> > calculation.
>
> actually i know the transform is going to be in the form of
> d(wt+phi)=3Ds*cos(wt+phi)+d2(wt+phi)

NO!

The complex transform X WILL NOT be a function of t.
The complex transform X will be a function of f.

The original signal x(t) can be expressed as a sum
of sinusoids with amplitudes, frequencies and phases determined by the
amplitudes and phases of the vector
X at the discrete frequencies in f.

doc fft
help fft

> I am trying to find a numerical value for the fourier
> series coefficient s.

Look at plot(f,abs(X)). The peaks will indicate the
dominant frequencies. However is not obvious to me
that one frequency will be so dominant that the others
can be neglected.

What dominant frequencies and peaks are you getting
when N =3D 128 and T =3D 2*pi?

Hope this helps.

Greg

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us