electronics forum

Rules | Recent posts | topic RSS | Search | Register  | Log in

audio signal analysis for comparing two signal


Post new topic  Reply to topic    EDAboard.com Forum Index -> Digital Signal Processing -> audio signal analysis for comparing two signal
Author Message
atmelAVR91



Joined: 02 Aug 2006
Posts: 70


Post05 Dec 2006 12:14   

audio signal analysis for comparing two signal


I want to do audio signal analysis for comparing two signal.

I think Radix-2 FFT decimation-in-frequency algorithm is good enough.
Please correct me if I am incorrect.

I want to do this on 8bit micro controller with internal 10bit ADC.

please give info links , Radix-2 FFT decimation-in-frequency C source code for 8bit controller.

Thanks
Back to top
rsrinivas



Joined: 10 Oct 2006
Posts: 419
Helped: 36
Location: bengalooru


Post06 Dec 2006 5:09   

audio signal analysis for comparing two signal


i think 8 bit isn't sufficient, u may lose precision
Back to top
atmelAVR91



Joined: 02 Aug 2006
Posts: 70


Post06 Dec 2006 8:46   

Re: audio signal analysis for comparing two signal


CPU core is 8 bit
precision is depends upon Math library I guess !
Back to top
Drago



Joined: 15 Nov 2005
Posts: 54
Helped: 4
Location: Bulgaria


Post06 Dec 2006 15:43   

audio signal analysis for comparing two signal


Yo will use FFT as a frequency representation of the two signals. How exactly you are planning to compare them (what measure)? . Does the system should be realtime ? What is the sampling frequency compared to the benchmarks of the CPU?
Back to top
atmelAVR91



Joined: 02 Aug 2006
Posts: 70


Post07 Dec 2006 5:46   

Re: audio signal analysis for comparing two signal


thanks drago

sampling frequency is 100/125 KHz
CPU is running @ 50 MHz ( MIPS )
system is non real time
I am planing to compare two signal within 1% accuarcy
Back to top
Drago



Joined: 15 Nov 2005
Posts: 54
Helped: 4
Location: Bulgaria


Post07 Dec 2006 10:55   

audio signal analysis for comparing two signal


If it is not a realtime system, the cpu doesn't mather, shurely it will do it ... someday Smile.
The sampling frequency is ok. Did you decide what frequency resolution you need? Therefore what is the FFT length?
"1%" is a relative measure, i.e. What you are going to compare the signal to? If you just subtract the frequencies of the two spectrums, you may be confused by a random high magnitude peak.
You should read about the measures, for example squared average distance, and then to compare the value with a predefined threshold. Ofcource you may use some sofisticated technics like neural netowrks or hidden markow models.
Remember there is much more noise that you expect Smile

Added after 12 minutes:

P.S. If you are planning to use the source code posted be Jools, keep in mind that the twiddle array W is with a double percision. Implementing a floating point arithmetics into a cpu withou an FPU unit is quite a slow solution.
Back to top
atmelAVR91



Joined: 02 Aug 2006
Posts: 70


Post07 Dec 2006 12:34   

Re: audio signal analysis for comparing two signal


thanks drago,

I am comparing sound captured from microphone with stored sample sound
I am comparing sound generated from mechnical machine.
I am doing this to analysis the life of mechnical parts

( stored sample sound is captured when machine was brand new )
Back to top
Drago



Joined: 15 Nov 2005
Posts: 54
Helped: 4
Location: Bulgaria


Post07 Dec 2006 15:30   

audio signal analysis for comparing two signal


The problem is quite clear now.
1. Are you shure that you have a mirophone with a frequency band up to 50/75 kHz ?
I think your problem is not very difficult if you have enough experimental data. This mean a number of recording of a broken(old) parts and the same for a brand new. I suppose each of the details should have specific spectrum. Therefore you should consider a weighted spectrum distance, because each piece will generate some specific frequencies. You only have to identify them and to make the weights.
I suggest you to make the complete experiment using Matlab (there is plenty of build-in functions like fft, etc.). Use recordings take a look of the spectrum, check diferent classification technics (or just measures with a treshold). When you are completely shure about the method and its results then you can go and implement it.
Since the sound is a random event (even when generated by the same source) in your case is better to calculate several consecutive spectrums and to average them.

Added after 7 minutes:

P.S. I just saw a book fo you
http://www.edaboard.com/viewtopic.php?t=173308&highlight=
Back to top
atmelAVR91



Joined: 02 Aug 2006
Posts: 70


Post07 Dec 2006 17:28   

Re: audio signal analysis for comparing two signal


thanks drago

can you please explain "weighted spectrum distance" in details and how to calculate in uC C software

is it different than FFT DIF
Back to top
Drago



Joined: 15 Nov 2005
Posts: 54
Helped: 4
Location: Bulgaria


Post07 Dec 2006 18:03   

audio signal analysis for comparing two signal


let us say that a sum of squared distance is:
s=sum( (X(1)-Y(1))^2 +(X(2)-Y(2))^2 + (X(3)-Y(3))^2 ....)
where X and Y are the FFT representations of the two signals x an y
but if you realize that frequency bin 2 is very important you may define a whetighting function like:
W=[0.1 0.9 0.1 ....]
which mean that frequencies 1 and 3 are not so important. Then the sum of weighted square distance should become like:
s=sum( W(1)*(X(1)-Y(1))^2 +W(2)*(X(2)-Y(2))^2 + W(3)*(X(3)-Y(3))^2 ....)
... It was a long time ago since I was working with MCU's. But if we speak about ANSI C, just replace the bracets "(" with "[" and SUM with FOR
P.S. you may normalize the sum with a SQRT and 1/N, but it is not absolutely neccessary since you are going to qompare the value with a threshold
Back to top
atmelAVR91



Joined: 02 Aug 2006
Posts: 70


Post07 Dec 2006 18:21   

Re: audio signal analysis for comparing two signal


drago

I don't understand what is FFT representations ?
X and Y are the FFT representations of the two signals x an y

and how to calculate W[] weights

do you have FFT radix DIF algorithum ?

Added after 6 minutes:

drago

FFT c code posted by Jools is (DIT) decimation in time or
(DIF) decimation in frequency
Back to top
Drago



Joined: 15 Nov 2005
Posts: 54
Helped: 4
Location: Bulgaria


Post07 Dec 2006 18:41   

audio signal analysis for comparing two signal


FFT representation means:
X=FFT{x}
where:
x time domain signal
X frequency domain signal, or spectrum
the Spectrum is a frequency representation of the time domain signal.
I'm not quite shure about the english therms. you shoud check some DSP book to be completely shure.
The weights W are choosen by you. Experimentally or based on some theory. They are just numbers between 0 and 1 and generally they mean that the non-important frequencies are suppressed.
Mainly I'm using Matlab where you may choose between many spectrum estimation technics, FFT, DCT, etc. I never needed to choose the radix, because this can result in a different cpu load (not important when developing the algorithm). When I'm programming a DSP in C I use a general FFT radix 2 algorithm from the TI's library optimized for TMS320C6711. You may obtain it too from their website.

Added after 3 minutes:

P.S. it doesn't mattter in which domain is the decimation you will need a bit reversal procedure anyway.
Back to top
Google
AdSense
Google Adsense




Post07 Dec 2006 18:41   

Ads




Back to top
vadkudr



Joined: 12 Jul 2005
Posts: 120
Helped: 12


Post08 Dec 2006 0:54   

Re: audio signal analysis for comparing two signal


This can help you, I think
ITU-R Recommendation BS. 1387-1: “Method for objective measurements of perceived audio quality,” 2001.

ITU-R.BS.1387-1.pdf

Try to find in internet
Back to top
Drago



Joined: 15 Nov 2005
Posts: 54
Helped: 4
Location: Bulgaria


Post08 Dec 2006 10:30   

audio signal analysis for comparing two signal


Very nice paper vadkur. I find it very usefull for me, but it is speech related.
atmelAVR91 wants to process a different kind of sounds where filter banks, or human perception does not fit to the paradigm. A sound created by a mashine will have very specific spectra and he has to find a way to make a decision based only on few very narrowband peaks I suppose. Using a critical band can make the information very fuzzy.

If you have read the paper in details, do you think you can define an objective measures between two classes (not two vectors)?
Back to top
atmelAVR91



Joined: 02 Aug 2006
Posts: 70


Post08 Dec 2006 10:31   

Re: audio signal analysis for comparing two signal


I am unable to find it

ITU-R Recommendation BS. 1387-1: “Method for objective measurements of perceived audio quality,” 2001.

ITU-R.BS.1387-1.pdf
Back to top
Drago



Joined: 15 Nov 2005
Posts: 54
Helped: 4
Location: Bulgaria


Post08 Dec 2006 10:44   

audio signal analysis for comparing two signal


It is quite easy.
1. Open google.com
2. in the search field type "ITU-R.BS.1387-1.pdf" and then press enter.
you will get a result with the pdf freely available.

in case you are experiencing some dificulties:
http://www.google.com/search?client=opera&rls=en&q=ITU-R.BS.1387-1.pdf&sourceid=opera&ie=utf-8&oe=utf-8
Back to top
Arabic versionBulgarian versionCatalan versionCzech versionDanish versionGerman versionGreek versionEnglish versionSpanish versionFinnish versionFrench versionHindi versionCroatian versionIndonesian versionItalian versionHebrew versionJapanese versionKorean versionLithuanian versionLatvian versionDutch versionNorwegian versionPolish versionPortuguese versionRomanian versionRussian versionSlovak versionSlovenian versionSerbian versionSwedish versionTagalog versionUkrainian versionVietnamese versionChinese version
Post new topic  Reply to topic    EDAboard.com Forum Index -> Digital Signal Processing -> audio signal analysis for comparing two signal
Page 1 of 1 All times are GMT + 1 Hour
Similar topics:
Comparing two audio spectrograms (1)
Separating two audio signal (7)
Can small signal analysis be used for large signal operation (6)
Small signal, large signal analysis (3)
Small signal VS. large signal analysis (7)
why we need to go for frequency domain signal analysis (2)
Tools for thermal analysis and signal integrity? (11)
ecg signal - need sample code for sampling negative signal (1)
how can i generate oe signal for sda bidirection signal? (2)
Stability for small signal and large signal? (5)


Abuse || Administrator || Moderators || Support us || sitemap
topic RSS