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:
Finding dominant frequencies with fft

Subject: Finding dominant frequencies with fft

From: Ironic Prata

Date: 22 Apr, 2012 23:35:06

Message: 1 of 6

Hi everyone

Did a search but could not find anything.

I want to obtain the dominant frequencies in a sound signal.
Is there an automatic way of doing this?

The only way i know how is to create a cycle, where i find max value of fft, delete the values in a window around it, and find new max.

Any smarter alternative?

Thanks

Subject: Finding dominant frequencies with fft

From: Ironic Prata

Date: 22 Apr, 2012 23:58:05

Message: 2 of 6

"Ironic Prata" wrote in message <jn24ja$jdi$1@newscl01ah.mathworks.com>...
> Hi everyone
>
> Did a search but could not find anything.
>
> I want to obtain the dominant frequencies in a sound signal.
> Is there an automatic way of doing this?
>
> The only way i know how is to create a cycle, where i find max value of fft, delete the values in a window around it, and find new max.
>
> Any smarter alternative?
>
> Thanks

An example: http://dl.dropbox.com/u/21845278/fft.jpg
Lets say i want to find the top 10 frequencies

Subject: Finding dominant frequencies with fft

From: Nasser M. Abbasi

Date: 23 Apr, 2012 02:15:50

Message: 3 of 6

On 4/22/2012 6:58 PM, Ironic Prata wrote:
> "Ironic Prata" wrote in message<jn24ja$jdi$1@newscl01ah.mathworks.com>...
>> Hi everyone
>>
>> Did a search but could not find anything.
>>
>> I want to obtain the dominant frequencies in a sound signal.
>> Is there an automatic way of doing this?
>>
>> The only way i know how is to create a cycle, where i find max value of fft,
>delete the values in a window around it, and find new max.
>>
>> Any smarter alternative?
>>
>> Thanks
>
> An example: http://dl.dropbox.com/u/21845278/fft.jpg
> Lets say i want to find the top 10 frequencies

frequencies, these are numbers, right? Then why not
sort abs(fft) and pick the first 10 numbers?

If I give you a list of 100 numbers and ask for the largest
10 numbers in the list, how would you do it?

--Nasser

Subject: Finding dominant frequencies with fft

From: Nasser M. Abbasi

Date: 23 Apr, 2012 02:29:34

Message: 4 of 6

On 4/22/2012 9:15 PM, Nasser M. Abbasi wrote:
> On 4/22/2012 6:58 PM, Ironic Prata wrote:
>> "Ironic Prata" wrote in message<jn24ja$jdi$1@newscl01ah.mathworks.com>...
>>> Hi everyone
>>>
>>> Did a search but could not find anything.
>>>
>>> I want to obtain the dominant frequencies in a sound signal.
>>> Is there an automatic way of doing this?
>>>
>>> The only way i know how is to create a cycle, where i find max value of fft,
>> delete the values in a window around it, and find new max.
>>>
>>> Any smarter alternative?
>>>
>>> Thanks
>>
>> An example: http://dl.dropbox.com/u/21845278/fft.jpg
>> Lets say i want to find the top 10 frequencies
>

> frequencies, these are numbers, right? Then why not
> sort abs(fft) and pick the first 10 numbers?
>
> If I give you a list of 100 numbers and ask for the largest
> 10 numbers in the list, how would you do it?
>

actually, may be a histogram would be better. This way
you make the bucket size (bin size) large to account
for bandwidth of each frequency to want to throw into
that bin. With sort, it can end up picking up
numbers that all belong to 'one' dominant frequency.

so try histc:

http://www.mathworks.com/help/techdoc/ref/histc.html

would be better than sort.

--Nasser

Subject: Finding dominant frequencies with fft

From: TideMan

Date: 23 Apr, 2012 04:22:50

Message: 5 of 6

On Monday, April 23, 2012 11:35:06 AM UTC+12, Ironic Prata wrote:
> Hi everyone
>
> Did a search but could not find anything.
>
> I want to obtain the dominant frequencies in a sound signal.
> Is there an automatic way of doing this?
>
> The only way i know how is to create a cycle, where i find max value of fft, delete the values in a window around it, and find new max.
>
> Any smarter alternative?
>
> Thanks

The human eye is a superb instrument for this, along with ginput.
In my experience identifying seiche periods in ocean signals, this is the best method because in the real world things are seldom straightforward, but our brains are very good at sifting the wheat from the chaff - we do it at a glance without even thinking about it.
Problems arise if you have to do it many times, but if it is just few, why not plot the spectrum and pick off the maxima manually using ginput to identify the exact frequencies?

Subject: Finding dominant frequencies with fft

From: Ironic Prata

Date: 23 Apr, 2012 21:39:07

Message: 6 of 6

TideMan <mulgor@gmail.com> wrote in message <4758672.1005.1335154970460.JavaMail.geo-discussion-forums@pbcnk6>...
> On Monday, April 23, 2012 11:35:06 AM UTC+12, Ironic Prata wrote:
> > Hi everyone
> >
> > Did a search but could not find anything.
> >
> > I want to obtain the dominant frequencies in a sound signal.
> > Is there an automatic way of doing this?
> >
> > The only way i know how is to create a cycle, where i find max value of fft, delete the values in a window around it, and find new max.
> >
> > Any smarter alternative?
> >
> > Thanks
>
> The human eye is a superb instrument for this, along with ginput.
> In my experience identifying seiche periods in ocean signals, this is the best method because in the real world things are seldom straightforward, but our brains are very good at sifting the wheat from the chaff - we do it at a glance without even thinking about it.
> Problems arise if you have to do it many times, but if it is just few, why not plot the spectrum and pick off the maxima manually using ginput to identify the exact frequencies?

It has to be automated. It's to run in a cycle to try a find a sound signature in a sound file.

Think will try hist.

Tks

Tags for this Thread

No tags are associated with 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