Technical discussions related to Audio Signal Processing (digital effects, acoustics, noise reduction, musical signal processing, etc).
Hello all
I have new to coding for DSP applications and I was hoping someone
could tell me if there is a good peak detection algorithm that I could
use and implemnet in C /C++ ? I would prefer if an algorithm or
pseudocode is provided. But it is not necessary. One approach is to
keep track of values until you find one that is less than its
predecessor. But since I am dealing with echoes, there are quite a few
peaks in a localized area. How do people usually deal with this
also I am currently using Haar wavelet techniques to do denoising and
I was hoping someone could tell me if my understandin of the following
conversion and arithmetic is correct for fixed point version.
32-bit , floating point variable.
VEctor a , length 2048, -1<=a<=1
Haar involves calculating
[a0/sqrt(2) + a1/sqrt(2)] and [a0/sqrt(2) - a1/sqrt(2)]
the 16 bit version will use short variables to store values
- multiply vector values by 32767 and cast to type (short)
- 1/sqrt(2) = 0.707107 = approx 11585/16384, denominator = 2^15
- do ((a0+a1)*11585)>>15 and ((a0-a1)*11585)>>15
- after right shift by 15 , cast to short and see if overflow or
underflow occurs, if overflow then set value to maximum(=32767) , else
if underflow,set value to minimum = -32768
please let me know if I am correct. Expecially whether I can check for
overflow/underflow after shifting bits.
thanks
osk
Hi osk, I've put in a few comments below: > Date: Thu, 13 Apr 2006 19:02:45 -0000 > From: "khan_os" <k...@yahoo.com> > Subject: dsp algorithms > > Hello all > > I have new to coding for DSP applications and I was hoping someone > could tell me if there is a good peak detection algorithm that I could > use and implemnet in C /C++ ? I would prefer if an algorithm or > pseudocode is provided. But it is not necessary. One approach is to > keep track of values until you find one that is less than its > predecessor. But since I am dealing with echoes, there are quite a few > peaks in a localized area. How do people usually deal with this > > also I am currently using Haar wavelet techniques to do denoising and > I was hoping someone could tell me if my understandin of the following > conversion and arithmetic is correct for fixed point version. > > 32-bit , floating point variable. > VEctor a , length 2048, -1<=a<=1 > Haar involves calculating > [a0/sqrt(2) + a1/sqrt(2)] and [a0/sqrt(2) - a1/sqrt(2)] > > the 16 bit version will use short variables to store values > - multiply vector values by 32767 and cast to type (short) The scale factor seem to be 32768, as the 1.0 (not representable) in Q15 is 2**15. > - 1/sqrt(2) = 0.707107 = approx 11585/16384, denominator = 2^15 sqrt(2)/2 is better wo write as 23170/32768. You used 2**14 rather than 15. > - do ((a0+a1)*11585)>>15 and ((a0-a1)*11585)>>15 See above. 11585 -> 23170 Regards, Andrew > - after right shift by 15 , cast to short and see if overflow or > underflow occurs, if overflow then set value to maximum(=32767) , else > if underflow,set value to minimum = -32768 > > please let me know if I am correct. Expecially whether I can check for > overflow/underflow after shifting bits. > > thanks > osk >
From: "khan_os" <k...@yahoo.com> > I have new to coding for DSP applications and I was hoping > someone could tell me if there is a good peak detection > algorithm that I could use and implemnet in C /C++ ? I would > prefer if an algorithm or pseudocode is provided. But it is not > necessary. One approach is to keep track of values until you > find one that is less than its predecessor. But since I am > dealing with echoes, there are quite a few peaks in a localized > area. How do people usually deal with this It depends on what you hope to do with the output. Since you haven't said anything about that, I' not sure about your concern with dense echo peaks -- do you want to catch them all or to gloss over some of them? Martin