DSPRelated.com
Forums

gamnitude range of a cepstrum

Started by NateS August 29, 2008
Hi, I am performing cepstral analysis and everything is working well. The
only thing I'm unsure about is how to determine the maximum magnitude I can
see in my cepstrum. I want to ignore peaks that don't have enough power. So
far I have just chosen a threshold that seems to make sense for the
magnitudes I am receiving. However I would like to express the threshold as
a percentage and I'd like it to work properly for an input signal. Is there
a function that defines what the maximum cepstrum magnitude can be?

Thanks,
-Nate
On Aug 29, 2:47&#4294967295;pm, "NateS" <m...@n4te.com> wrote:
> Hi, I am performing cepstral analysis and everything is working well. The > only thing I'm unsure about is how to determine the maximum magnitude I can > see in my cepstrum. I want to ignore peaks that don't have enough power. So > far I have just chosen a threshold that seems to make sense for the > magnitudes I am receiving. However I would like to express the threshold as > a percentage and I'd like it to work properly for an input signal. Is there > a function that defines what the maximum cepstrum magnitude can be? > > Thanks, > -Nate
I dont think there is any limit on cepstrum magnitude.You may want to express the threshold as the percentage of the maximum value of cepstrum for that window.
On Aug 29, 2:47&#4294967295;pm, "NateS" <m...@n4te.com> wrote:
> Hi, I am performing cepstral analysis and everything is working well. The > only thing I'm unsure about is how to determine the maximum magnitude I can > see in my cepstrum. I want to ignore peaks that don't have enough power. So > far I have just chosen a threshold that seems to make sense for the > magnitudes I am receiving. However I would like to express the threshold as > a percentage and I'd like it to work properly for an input signal. Is there > a function that defines what the maximum cepstrum magnitude can be? > > Thanks, > -Nate
What are you tryin to achieve BTW.
The following method is called gamnitude: gamble-on-magnitude.  Pick three
numbers between 1 and 10.  If the sum exceeds 21, set the threshold larger
than your maximum observed value (you lose all the data.)  If the sum is
less than 21, set threshold to zero (you keep all the data, but you don't
get what you want.) 

If the sum of the numbers is 21 (you might skip to this phase directly),
you can estimate a noise variance using a moving average window (it helps
to exclude the outliers). Then you can choose a certain number of times
this variance as your threshold. Play with the scaling factor to see what
works for you..  (If you want to do this more rigorously, look up CFAR.)

Good luck!  :-)

Emre
>On Aug 29, 2:47=A0pm, "NateS" <m...@n4te.com> wrote: >> Hi, I am performing cepstral analysis and everything is working well.
The
>> only thing I'm unsure about is how to determine the maximum magnitude I
c=
>an >> see in my cepstrum. I want to ignore peaks that don't have enough
power. =
>So >> far I have just chosen a threshold that seems to make sense for the >> magnitudes I am receiving. However I would like to express the
threshold =
>as >> a percentage and I'd like it to work properly for an input signal. Is
the=
>re >> a function that defines what the maximum cepstrum magnitude can be? >> >> Thanks, >> -Nate > >I dont think there is any limit on cepstrum magnitude.You may want to >express >the threshold as the percentage of the maximum value of cepstrum for >that window. >
The point of the threshold is to ignore cepstrum peaks that don't have enough power. What happens is if the input signal has no harmonics, I am still processing cepstrum peaks. Is there a standard way of handling this? My initial reaction was to ignore peaks that don't have much power. For this to work I need to quantify the cepstrum magnitude. I can't use the maximum value in the cepstrum window because the whole window might not have much power. I suppose another solution might be to take a mean or median or stddev of the cepstrum and ignore peaks that did not differ by much. But again, I need to quantify "much". Also I feel like I'm just making this up. :) This may be naive, but it seems like the magnitude of the cepstrum should be relative to the numbers use in the input signal, no? -Nate
>I suppose another solution might be to take a mean or median or stddev of >the cepstrum and ignore peaks that did not differ by much. But again, I >need to quantify "much". Also I feel like I'm just making this up. :) > >This may be naive, but it seems like the magnitude of the cepstrum
should
>be relative to the numbers use in the input signal, no? > >-Nate
Nate, This is exactly what I suggested above.. (Ignore the teaser in the first paragraph. I couldn't hold back on the joke, sorry. Did anyone get it?) CFAR-detection is used to detect peaks in a noisy environment, and it uses the variance of the noise to see what is significantly larger. Estimating the noise variance may be tricky, but there are moving average and/or order selection methods which work well in practice. Emre
>>I suppose another solution might be to take a mean or median or stddev
of
>>the cepstrum and ignore peaks that did not differ by much. But again, I >>need to quantify "much". Also I feel like I'm just making this up. :) >> >>This may be naive, but it seems like the magnitude of the cepstrum >should >>be relative to the numbers use in the input signal, no? >> > >This is exactly what I suggested above.. (Ignore the teaser in the first >paragraph. I couldn't hold back on the joke, sorry. Did anyone get it?) >CFAR-detection is used to detect peaks in a noisy environment, and it
uses
>the variance of the noise to see what is significantly larger.
Estimating
>the noise variance may be tricky, but there are moving average and/or
order
>selection methods which work well in practice. > >Emre >
Heh, sorry I was being dense. I have implemented this: 1) Find a peak I'm interested in. 2) Find average of X surrounding bins, excluding the two adjacent. 3) Disregard peak if not greater than the average times 5. This seems to work ok. The only question I have is, how many surrounding bins should I include in the average? I have tried 10 to the whole window, but I'm not sure what is better.
I have both positive and negative numbers for my cepstrum magnitudes.
Should I just ignore negative numbers? Obviosuly including them in the
averaging hoses everything (pushes the average way down, making most peaks
pass the CFAR).
>Heh, sorry I was being dense. I have implemented this:
>1) Find a peak I'm interested in. >2) Find average of X surrounding bins, excluding the two adjacent. >3) Disregard peak if not greater than the average times 5.
>This seems to work ok. The only question I have is, how many surrounding >bins should I include in the average? I have tried 10 to the whole
window,
>but I'm not sure what is better.
Length of the moving window is also a parameter you should tune to your needs. In theory, if the noise in all bins are i.i.d. than you can use a single window covering all bins. Otherwise, it should be long enough to provide an estimate with low variance, and short enough to avoid mixing small apples and big apples (bins with different variances.) Also try order-selection CFAR: instead of finding the average within the window, say find the 75th percentile, and scale that to set a threshold.
>I have both positive and negative numbers for my cepstrum magnitudes. >Should I just ignore negative numbers? Obviosuly including them in the >averaging hoses everything (pushes the average way down, making most
peaks
>pass the CFAR).
Try squaring the value of each bin. After all, a large negative peak can also be your desired signal, right? (If not, this information is also of value.) Emre
>Try squaring the value of each bin. After all, a large negative peak can >also be your desired signal, right? (If not, this information is also
of
>value.) >
You might also just take the magnitude instead of the square, and see which works better for you.. Normally you would consider the probability distribution of the noise magnitude, and then you would set the threshold so as to fix a false-alarm probability (hence the name CFAR - constant false alarm probability).. If you do it this way, it should not matter whether you are using magnitude or squared-magnitude. Emre