Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Problem with fourier transform
Replies: 19   Last Post: May 27, 2009 11:24 PM

 Messages: [ Previous | Next ]
 alfredo Posts: 11 Registered: 5/27/09
Re: Problem with fourier transform
Posted: May 27, 2009 4:50 PM

"Matt " <xys@whatever.com> wrote in message <gvjkbs\$hqb\$1@fred.mathworks.com>...
> "acepsut " <acepsut@gmail.com> wrote in message <gvj28h\$o91\$1@fred.mathworks.com>...
> > Matt please excuse me I forgot the fourier function:
> >
> > function [Y,K]=fourier(serie,Tmax,Tmin,step)
> >
> > k=1;
> > K=Tmin:step:Tmax;
> > for X=Tmin:step:Tmax,
> > Y(k)=sum(serie.*(exp(-i*2*pi*(1./X).*(1:length(serie)))));
> > k=k+1;

>
>
> This is a bizarre looking expression for a Fourier transform. In the complex exponent you are dividing by your time axis samples?
>
> Below is the code I used and I get sensible looking peaks in the amplitude plot
>
>
> T1=90; f1=1/T1,
> T2=75; f2=1/T2,
>
>
>
>
> df=abs(f1-f2)/10,
> dt=0.01,
> N=ceil(1/dt/df),
> df=1/N/dt
>
> t_axis=dt*( -ceil((N-1)/2):N-1-ceil((N-1)/2) );
> f_axis=df*( -ceil((N-1)/2):N-1-ceil((N-1)/2) );
>
>
> f=@(T,A,phi,t) A*cos(2*pi/T*t-phi);
> Cos1=f(T1,60,2.2,ifftshift(t_axis));
> Cos2=f(T2,30,1.1,ifftshift(t_axis));
>
>
> Spectrum=fftshift( fft(Cos1+Cos2)*dt );
>
> figure(1);
>
> flim=max(f1,f2)*3;
>
>
> plot(f_axis,abs(Spectrum));
> title 'Mag Response'
> xlim([-flim flim])

Hi Matt, if I want take my signal in time domain and transform this (with fft or fourier trasform) to search which kind of frequencies are present , how can I choose the value of df ( if I don't know in my case f1 and f2)?

Best regards

Alfredo Ciclopico

Date Subject Author
5/27/09 acepsut@gmail.com
5/27/09 Matt
5/27/09 acepsut@gmail.com
5/27/09 acepsut@gmail.com
5/27/09 Matt
5/27/09 acepsut@gmail.com
5/27/09 Matt
5/27/09 alfredo
5/27/09 alfredo
5/27/09 alfredo
5/27/09 Matt
5/27/09 Greg Heath
5/27/09 Matt
5/27/09 acepsut@gmail.com
5/27/09 Matt
5/27/09 acepsut@gmail.com
5/27/09 Greg Heath
5/27/09 Derek Goring
5/27/09 acepsut@gmail.com
5/27/09 Greg Heath