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:
fft, frequecy of a signal

Subject: fft, frequecy of a signal

From: muzaffar

Date: 16 Jun, 2008 07:49:02

Message: 1 of 10

Dear All,
Hi,
i have a signal out put taken in micro second time domain.
How can i find out its frequency?
Kind regards.

Subject: fft, frequecy of a signal

From: Greg Heath

Date: 16 Jun, 2008 10:23:14

Message: 2 of 10

On Jun 16, 3:49=A0am, "muzaffar " <muzaffarbas...@yahoo.com> wrote:
> Dear All,
> Hi,
> i have a signal out put taken in micro second time domain.
> How can i find out its frequency?
> Kind regards.

help fft
doc fft

Hope this helps.

Greg

Subject: fft, frequecy of a signal

From: Nasser Abbasi

Date: 17 Jun, 2008 07:15:34

Message: 3 of 10


"muzaffar " <muzaffarbashir@yahoo.com> wrote in message
news:g355te$q0r$1@fred.mathworks.com...
> Dear All,
> Hi,
> i have a signal out put taken in micro second time domain.
> How can i find out its frequency?
> Kind regards.
>

Sorry, but I can't parse the above.

What exactly is the known information about the signal?

Nasser

Subject: fft, frequecy of a signal

From: muzaffar

Date: 17 Jun, 2008 08:00:20

Message: 4 of 10

"Nasser Abbasi" <nma@12000.org> wrote in message
<zvJ5k.12906$Ri.2282@flpi146.ffdc.sbc.com>...
>
> "muzaffar " <muzaffarbashir@yahoo.com> wrote in message
> news:g355te$q0r$1@fred.mathworks.com...
> > Dear All,
> > Hi,
> > i have a signal out put taken in micro second time
domain.
> > How can i find out its frequency?
> > Kind regards.
> >
>
> Sorry, but I can't parse the above.
>
> What exactly is the known information about the signal?
>
> Nasser
>
>
Thanks for the reply,
I know length of the signal, total time and time intervals
for values of output.
i want to know what is frequency?
kind regards.

Subject: fft, frequecy of a signal

From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)

Date: 17 Jun, 2008 11:41:05

Message: 5 of 10

In article <g37quk$et6$1@fred.mathworks.com>,
muzaffar <muzaffarbashir@yahoo.com> wrote:
>"Nasser Abbasi" <nma@12000.org> wrote in message
><zvJ5k.12906$Ri.2282@flpi146.ffdc.sbc.com>...
>> "muzaffar " <muzaffarbashir@yahoo.com> wrote in message
>> news:g355te$q0r$1@fred.mathworks.com...

>> > How can i find out its frequency?

>I know length of the signal, total time

Standard definition of frequency: samples per second.
So divide the number of samples (the length) by the total time.
(Provided, that is, that the signal was sampled at regular
intervals.)
--
  "Prevention is the daughter of intelligence."
                                              -- Sir Walter Raleigh

Subject: fft, frequecy of a signal

From: Bryan

Date: 17 Jun, 2008 13:14:02

Message: 6 of 10

roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson) wrote in
message <g387sh$48v$1@canopus.cc.umanitoba.ca>...
> Standard definition of frequency: samples per second.
> So divide the number of samples (the length) by the
total time.
> (Provided, that is, that the signal was sampled at
regular
> intervals.)
> --
> "Prevention is the daughter of intelligence."
> -- Sir
Walter Raleigh


I'm new to a lot of this, so this question is as much for
my own understanding as it is for the original poster.

Wouldn't this depend on the 'type' of frequency they are
looking for? Taking the number of samples and dividing by
the total time would give them the sampling frequency, but
not the frequency of the analog signal that was sampled.
For instance, you can have a 1 Hz signal that is sampled
at 1 MHz. (# of samples) / (total time) would equal 1
MHz, but that isn't the frequency of the signal, which is
1 Hz.

Does that make any sense or am I totally off-base here?

Subject: fft, frequecy of a signal

From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)

Date: 17 Jun, 2008 13:25:17

Message: 7 of 10

In article <g38daq$671$1@fred.mathworks.com>,
Bryan <bdg146.removeThis@gmail.com> wrote:
>roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson) wrote in
>message <g387sh$48v$1@canopus.cc.umanitoba.ca>...
>> Standard definition of frequency: samples per second.

>Wouldn't this depend on the 'type' of frequency they are
>looking for? Taking the number of samples and dividing by
>the total time would give them the sampling frequency, but
>not the frequency of the analog signal that was sampled.

True.

>For instance, you can have a 1 Hz signal that is sampled
>at 1 MHz. (# of samples) / (total time) would equal 1
>MHz, but that isn't the frequency of the signal, which is
>1 Hz.

>Does that make any sense or am I totally off-base here?

No, you are correct, but it should be kept in mind that
when an analog signal is sampled, there will *always* be
multiple frequencies involved, so one would not talk about
"the frequency" (which presumes there is only a single frequency.)

No matter how pure the analog frequency is, sampling it at any
finite sample rate with any finite number of bits per sample
will -necessarily- quantize the signal, converting it into
a finite sequence of square waves. When you fft the signal,
you can always see the effect of the square wave approximation.
The purer the original tone and the lower the noise and the more
accurate (bits per sample) you get the readings, the less noticable
will be the affect on the fft compared to the ideal fft.

Usually the primary visible artifact in the fft of the discretized
signal will be a phase shift, but there will also be infinite
harmonics (as high up as the sampling frequency can distinguish
between them.)
--
  "Ignorance has been our king... he sits unchallenged on the throne of
  Man. His dynasty is age-old. His right to rule is now considered
  legitimate. Past sages have affirmed it. They did nothing to unseat
  him." -- Walter M Miller, Jr

Subject: fft, frequecy of a signal

From: Per Sundqvist

Date: 17 Jun, 2008 14:00:24

Message: 8 of 10

"Bryan " <bdg146.removeThis@gmail.com> wrote in message
<g38daq$671$1@fred.mathworks.com>...
> roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson) wrote in
> message <g387sh$48v$1@canopus.cc.umanitoba.ca>...
> > Standard definition of frequency: samples per second.
> > So divide the number of samples (the length) by the
> total time.
> > (Provided, that is, that the signal was sampled at
> regular
> > intervals.)
> > --
> > "Prevention is the daughter of intelligence."
> > -- Sir
> Walter Raleigh
>
>
> I'm new to a lot of this, so this question is as much for
> my own understanding as it is for the original poster.
>
> Wouldn't this depend on the 'type' of frequency they are
> looking for? Taking the number of samples and dividing by
> the total time would give them the sampling frequency, but
> not the frequency of the analog signal that was sampled.
> For instance, you can have a 1 Hz signal that is sampled
> at 1 MHz. (# of samples) / (total time) would equal 1
> MHz, but that isn't the frequency of the signal, which is
> 1 Hz.
>
> Does that make any sense or am I totally off-base here?

If you use fft you would get a frequency spectra. Assuming
that you have sampled the signal over many periods and small
time steps you would get a sharp maximum at "the frequency".
If you only have one period, you would get other components
of frequency. This phenomenon is similar to Heissenbergs
uncertinity principle.

Now fft is not so user-friendly, but if you look through the
example:
<a
href="http://www.mathworks.com/access/helpdesk/help/techdoc/index.html?/access/helpdesk/help/techdoc/ref/fft.html">fft-example</a>

(http://www.mathworks.com/access/helpdesk/help/techdoc/index.html?/access/helpdesk/help/techdoc/ref/fft.html)

Then, "the frequency" will approximately be obtained by:
[dummy,ix]=sort(abs(Y(1:NFFT/2));
f_max=f(ix(end)) %the dominating frequency component

Good luck,
Per

Subject: fft, frequecy of a signal

From: Carlos Adrian Vargas Aguilera

Date: 17 Jun, 2008 22:08:01

Message: 9 of 10

I made a function for this kind of little problems with fft.
If you want you can check out my function fouriertransform.m at:

http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=13327&objectType=FILE

Saludos,

Carlos Vargas

Subject: fft, frequecy of a signal

From: Miroslav Balda

Date: 18 Jun, 2008 04:15:03

Message: 10 of 10

"muzaffar " <muzaffarbashir@yahoo.com> wrote in message
<g355te$q0r$1@fred.mathworks.com>...
> Dear All,
> Hi,
> i have a signal out put taken in micro second time domain.
> How can i find out its frequency?
> Kind regards.
>
Hi
Your problem solves comletely the function sinfapm, should
the signal be harmonic. You will find it at
http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=19902&objectType=FILE
Hope it helps

Mira

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