DSPRelated.com
Forums

Newbie: Help with acoustic signature detector

Started by Leonardo Capossio June 24, 2015
Hello, I am a newbie in DSP, but have received courses in LTI systems, FIR and IIR filters, convolution, and have extensive knowledge on FPGA architectures and development (mostly non-DSP stuff, in DSP only FIR/IIR filters). I would like to make a system that detects audio-frequency signatures, but lets say mostly periodic signals (let's say i would like to detect up to the 2nd harmonic) in a basic way (to get me started). I don't want to do voice recognition or anything like that, just detect periodic signals that have a known power in the 1st and 2nd harmonic (maybe even 3rd).

I am looking for a DSP architecture for doing so, but not necessarily with implementation details. Just architecture and explanation for said architecture and possible variations.

Thanks.
On 6/24/15 2:26 PM, Leonardo Capossio wrote:
> I would like to make a system that detects audio-frequency > signatures, but lets say mostly periodic signals (let's say > i would like to detect up to the 2nd harmonic) in a basic way > (to get me started). I don't want to do voice recognition or > anything like that, just detect periodic signals that have a > known power in the 1st and 2nd harmonic (maybe even 3rd).
do you want to know the frequencies and amplitudes of the 1st, 2nd, and 3rd harmonics? by having "a known power in the 1st and 2nd harmonic ", do you mean relatively to each other or relative to some other power reference (like the rails)?
> I am looking for a DSP architecture for doing so, but not > necessarily with implementation details. Just architecture > and explanation for said architecture and possible variations.
this is probably a similar problem we have in music and audio processing in detecting a note or tone. most musical notes are quasi-periodic functions. a common way we normally detect an isolated note, not so badly interfered from other notes, is with autocorrelation (ACF) or something similar to the Average Magnitude Difference Function (AMDF). Dmitry Terez (a.k.a. "angrydude") has a method that is patented that is, in my opinion, a jazzed-up form of AMDF. there is a variation of AMDF that i like where the difference is squared instead of the magnitude (abs value) computed. sometimes it's call the Average Squared Difference Function (ASDF). the ASDF and the ACF are unside-down copies of each other. the first will have a deep valley when the latter has a peak (at integer multiples of the period). in my opinion, frequency-domain techniques, like doing an FFT on a snippet of audio, are not such a great way to detect a tone. a bank of various comb filters might be another way to detect a tone. that is sorta what AMDF or ASDF do also. if, once you have detected that a tone exists from ACF or AMDF or ASDF and you have determined the period, it can be resampled so that the period is exactly N samples long. then an N-point DFT or FFT can be done to that single period and you will know the amplitudes (and phases) of all of the harmonics, if that is the information you are looking for.
> Thanks.
FWIW. -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."
El mi�rcoles, 24 de junio de 2015, 16:00:56 (UTC-3), robert bristow-johnson escribi�:
> On 6/24/15 2:26 PM, Leonardo Capossio wrote: > > I would like to make a system that detects audio-frequency > > signatures, but lets say mostly periodic signals (let's say > > i would like to detect up to the 2nd harmonic) in a basic way > > (to get me started). I don't want to do voice recognition or > > anything like that, just detect periodic signals that have a > > known power in the 1st and 2nd harmonic (maybe even 3rd). > > do you want to know the frequencies and amplitudes of the 1st, 2nd, and > 3rd harmonics? by having "a known power in the 1st and 2nd harmonic ", > do you mean relatively to each other or relative to some other power > reference (like the rails)? >
Either is possible, depending on the database.
> > I am looking for a DSP architecture for doing so, but not > > necessarily with implementation details. Just architecture > > and explanation for said architecture and possible variations. > > this is probably a similar problem we have in music and audio processing > in detecting a note or tone. most musical notes are quasi-periodic > functions. > > a common way we normally detect an isolated note, not so badly > interfered from other notes, is with autocorrelation (ACF) or something > similar to the Average Magnitude Difference Function (AMDF). Dmitry > Terez (a.k.a. "angrydude") has a method that is patented that is, in my > opinion, a jazzed-up form of AMDF. > > there is a variation of AMDF that i like where the difference is squared > instead of the magnitude (abs value) computed. sometimes it's call the > Average Squared Difference Function (ASDF). the ASDF and the ACF are > unside-down copies of each other. the first will have a deep valley > when the latter has a peak (at integer multiples of the period). > > in my opinion, frequency-domain techniques, like doing an FFT on a > snippet of audio, are not such a great way to detect a tone. > > a bank of various comb filters might be another way to detect a tone. > that is sorta what AMDF or ASDF do also. > > if, once you have detected that a tone exists from ACF or AMDF or ASDF > and you have determined the period, it can be resampled so that the > period is exactly N samples long. then an N-point DFT or FFT can be > done to that single period and you will know the amplitudes (and phases) > of all of the harmonics, if that is the information you are looking for. > > > Thanks. > > FWIW. > > -- > > r b-j rbj@audioimagination.com > > "Imagination is more important than knowledge."
Do you have a recommendation on literature in this matters ??? If I want to detect many different fundamental frequencies, is there a way to dynamically do this with a technique, or only through replication of the filters ?
On 6/25/15 11:41 AM, Leonardo Capossio wrote:
> El mi�rcoles, 24 de junio de 2015, 16:00:56 (UTC-3), robert bristow-johnson escribi�: >> On 6/24/15 2:26 PM, Leonardo Capossio wrote: >>> I would like to make a system that detects audio-frequency >>> signatures, but lets say mostly periodic signals (let's say >>> i would like to detect up to the 2nd harmonic) in a basic way >>> (to get me started). I don't want to do voice recognition or >>> anything like that, just detect periodic signals that have a >>> known power in the 1st and 2nd harmonic (maybe even 3rd). >> >> do you want to know the frequencies and amplitudes of the 1st, 2nd, and >> 3rd harmonics? by having "a known power in the 1st and 2nd harmonic ", >> do you mean relatively to each other or relative to some other power >> reference (like the rails)? >> > > Either is possible, depending on the database. > >>> I am looking for a DSP architecture for doing so, but not >>> necessarily with implementation details. Just architecture >>> and explanation for said architecture and possible variations. >> >> this is probably a similar problem we have in music and audio processing >> in detecting a note or tone. most musical notes are quasi-periodic >> functions. >> >> a common way we normally detect an isolated note, not so badly >> interfered from other notes, is with autocorrelation (ACF) or something >> similar to the Average Magnitude Difference Function (AMDF). Dmitry >> Terez (a.k.a. "angrydude") has a method that is patented that is, in my >> opinion, a jazzed-up form of AMDF. >> >> there is a variation of AMDF that i like where the difference is squared >> instead of the magnitude (abs value) computed. sometimes it's call the >> Average Squared Difference Function (ASDF). the ASDF and the ACF are >> unside-down copies of each other. the first will have a deep valley >> when the latter has a peak (at integer multiples of the period). >> >> in my opinion, frequency-domain techniques, like doing an FFT on a >> snippet of audio, are not such a great way to detect a tone. >> >> a bank of various comb filters might be another way to detect a tone. >> that is sorta what AMDF or ASDF do also. >> >> if, once you have detected that a tone exists from ACF or AMDF or ASDF >> and you have determined the period, it can be resampled so that the >> period is exactly N samples long. then an N-point DFT or FFT can be >> done to that single period and you will know the amplitudes (and phases) >> of all of the harmonics, if that is the information you are looking for. >> > > Do you have a recommendation on literature in this matters ??? > > If I want to detect many different fundamental frequencies, is there a way to dynamically do this with a technique, or only through replication of the filters ?
Google "pitch detection algorithm". it's not particularly easy, nor particularly difficult. you do this on a buffer or block of samples. you might end up updating the pitch estimation, perhaps once every 2 or 5 milliseconds. but the technique is "autocorrelation" or "AMDF", look them up. -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."