Sign in

username:

password:



Not a member?

Search audiodsp



Search tips

Subscribe to audiodsp



audiodsp by Keywords

AAC | ADPCM | Convolution | DAFx | FFT | IIR | Mixer | MP3 | MPEG | MPEG-4

Ads

Discussion Groups

Technical discussions related to Audio Signal Processing (digital effects, acoustics, noise reduction, musical signal processing, etc).

  

Post a new Thread

dsp algorithms - khan_os - Apr 14 6:54:11 2006



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



(You need to be a member of audiodsp -- send a blank email to audiodsp-subscribe@yahoogroups.com )

Re: dsp algorithms - Andrew Nesterov - Apr 17 8:14:03 2006

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
>



(You need to be a member of audiodsp -- send a blank email to audiodsp-subscribe@yahoogroups.com )

Re: dsp algorithms - Martin Eisenberg - Apr 17 8:19:11 2006

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



(You need to be a member of audiodsp -- send a blank email to audiodsp-subscribe@yahoogroups.com )