6
$\begingroup$

I am looking for an algorithm to measure attenuation of a discrete signal $s[t]$. Starting at the beginning of the signal sequence, is it possible to compute either sliding DFT or Gabor transform windows and use the amplitude and phase information to compute an attenuation coefficient? Is a reference available for such an algorithm? I am wondering if similar algorithms have been applied in music DSP.

Is there a separate attenuation coefficient computed for both the real and complex parts of the frequency-domain signal?

Here are some further details:

  1. For each window, I want to compute attenuation of the signal. So for every $\tau$, where $\tau$ is the center of the window, I get an estimate of attenuation over the width of the window. As the window moves over the signal $s[t]$, I get an estimate of attenuation $\alpha[\tau]$ as a function of the window center.
  2. Sliding DFT is used for computational efficiency (link), and I think that there may also be other benefits to using the sliding DFT as well. Should I apply a Blackman/Hanning window in the time domain? Or perhaps the Gabor transform would suffice.
  3. $s[t]$ is considered to contain a single signal of interest.
  4. The attenuation coefficient can be expressed with a real part and a complex part, and can be reported in units of dB. Here is an equation:

$A = A_0 \exp[\frac{{ - \omega \tau }}{{2\alpha }}]$

$A$ is the amplitude and phase at a time $\tau_k$, and $A_0$ is some reference amplitude and phase, $\alpha$ is the attenuation coefficient, $\tau$ is the time at the window center, and $\omega$ is angular frequency.

How do I define the reference amplitude and phase $A_0$? Maybe $A_0$ would be defined at the beginning of the signal. Or maybe $A_0$ would be defined at the beginning of each window? In addition, how do I deal with spikes in the signal spectrum? Maybe some sort of smoothing algorithm would be beneficial here?

Moreover, maybe the attenuation could be determined using a signal envelope detector? How might I set this up?

UPDATE

I think this problem might be associated with separating two signals that have been added together. We don't know the reference amplitude $A_0$ and it might change over time. Take:

$A[\tau, \omega] = A_0[\tau, \omega]\exp[\frac{{ - \omega \tau }}{{2\alpha }}]$

$\log(A[\tau, \omega]) = \log(A_0[\tau, \omega]) + [\frac{{ - \omega \tau }}{{2\alpha }}]$

Here are some assumptions:

  1. $A_0[\tau, \omega]$ is unknown, but it can be assumed as being uncorrelated with $[\frac{{ - \omega \tau }}{{2\alpha }}]$. The bandwidth of $A_0[\tau, \omega]$ is different than the bandwidth of $[\frac{{ - \omega \tau }}{{2\alpha }}]$. (I think this is reasonable.) The bandwidth of the $[\frac{{ - \omega \tau }}{{2\alpha }}]$ expression is known.
  2. $\alpha$ is constant for each $\tau$.
  3. $A[\tau, \omega]$ is computed using the Short Time Fourier Transform or Gabor transform.
  4. The envelopes of $A[\tau, \omega]$ and $A_0[\tau, \omega]$ are not constant. However, $\exp[\frac{{ - \omega \tau }}{{2\alpha }}]$ is just an equation. So can I treat $A_0$ as simply being "noise" or something else?
  5. $A_0[\tau, \omega]$ and $A[\tau, \omega]$ are complex. The attenuation $\alpha$ is a real number.

Can someone help me set up the math (i.e. matrix equation?) or point me in the right direction to a class of algorithms? I think this problem is very similar to separation of two signals.

Perhaps this can be done using a Kalman filter, where $\log(A_0[\tau, \omega])$ is treated as "noise" and the $[\frac{{ - \omega \tau }}{{2\alpha }}]$ term is treated as the signal. Is this reasonable, and is there a good reference available on the implementation of this filter? Perhaps another filter would be more appropriate?

The output of the operation would be a graph of attenuation with respect to time, as I have drawn below. I also show the Gabor transform operation with the addition of two signals. Image

UPDATE

To explore this problem more, I've selected a test signal and written a program to forward filter the test signal using a kernel that simulates the attenuation I want to determine. I work with sonar and acoustic sensing systems, so selecting this signal demonstrates what I am working with.

Here is a plot of the test signal in the time domain. This is a signal with no attenuation:

Test signal

Here is the Gabor transform (spectrogram) of the signal with no attenuation:

No attenuation spectrogram

Here is a plot of the test signal after I've applied a filter to simulate attenuation. This is a signal with constant attenuation, such that $\alpha(\tau) = 55$:

Signal with attenuation

Here is the Gabor transform (spectrogram) of the signal with attenuation. Notice how there is an exponential decay in the spectrogram:

Signal with attenuation

Looking at the absolute value of the forward filter kernel, the exponential decay is very apparent. Notice how some frequencies are decayed more than others. The forward filter kernel has a real and a complex part. The plot below is simply the absolute value of the forward filter kernel. The higher the numerical value of the filter kernel (approaching 1.0), the less attenuation. The lower the numerical value of the filter kernel (approaching 0), the more attenuation.

Forward filter kernel

Here is the mathematical form of the filter kernel $k(\tau, \omega)$ that has been applied by multiplication with the original Gabor-transformed signal:

$k(\tau ,\omega ) = \frac{1}{{\Lambda (\tau ,\omega )}}\exp \left[ {i\int\limits_0^\tau {{{\left( {\frac{\omega }{{{\omega _h}}}} \right)}^{\frac{1}{{\pi \alpha (\tau ')}}}}\omega d\tau '} } \right]$

$\Lambda (\tau ,\omega ) = \frac{{\beta (\tau ,\omega ) + {\sigma ^2}}}{{{\beta ^2}(\tau ,\omega ) + {\sigma ^2}}}$

$\beta (\tau ,\omega ) = \exp \left[ { - \int\limits_0^\tau {\frac{\omega }{{2\alpha (\tau ')}}{{\left( {\frac{\omega }{{{\omega _h}}}} \right)}^{\frac{{ - 1}}{{\pi \alpha (\tau ')}}}}d\tau '} } \right]$

In the above, $\omega, \omega_h, \sigma, \tau$ are all known, and for simplicity I have set the attenuation $\alpha(\tau) = 55$ across the entire signal.

I would like to find the attenuation $\alpha(\tau)$ as a function of time $\tau$, but $\alpha(\tau)$ does not have to be constant, and can change over $\tau$.

I think that the filter kernel is "smooth," whereas the original signal is not.

Is there a way to determine attenuation $\alpha(\tau)$, even in a non-exact way?

Here I repeat the same experiment for an $\alpha(\tau)$ that changes over time. This is a model of what I would expect $\alpha(\tau, \omega)$ to be (but the curve could also be linear with a negative slope, or something else entirely):

Alpha changes

For sake of exposition, here is the original (non-filtered) trace again. This is a signal with no attenuation:

enter image description here enter image description here

This is a signal with attenuation, where $\alpha(\tau)$ changes over time:

enter image description here enter image description here

Here is the absolute value of the filter kernel where $\alpha(\tau)$ changes over time. Note that the exponential decay is still present here:

enter image description here

Another perspective

Now I realize that the forward filter in the Gabor transform domain is given by:

$A(\tau, \omega) = A_0(\tau, \omega)k(\tau, \omega)$

So the attenuated trace is $A(\tau, \omega)$, and $A_0(\tau, \omega)$ is the non-attenuated trace, and $k(\tau, \omega)$ is the filter kernel. Given $A(\tau, \omega)$, but not $A_0(\tau, \omega)$, I would like to estimate $\alpha(\tau)$, the attenuation function over time. In this case, I know the numerical form of the filter kernel $k(\tau, \omega)$, but I do not know $\alpha(\tau)$. This is why I wonder if Kalman filtering would be beneficial to use in this type of problem. Perhaps $A_0(\tau, \omega)$ could be treated as noise uncorrelated with the kernel $k(\tau, \omega)$.

Looking at the attenuated spectrograms, I am reminded of image "de-blurring" algorithms. Since the kernel is "smooth" and the original signal $A_0(\tau, \omega)$ is not, it might be possible to somehow separate the $A_0(\tau, \omega)$ from the kernel $k(\tau,\omega)$ using some sort of algorithm.

If I can separate the $A_0(\tau, \omega)$ from the kernel $k(\tau,\omega)$, then I think that can estimate $\alpha(\tau)$.

UPDATE

Here is a spectrogram of actual data. The datasets above were synthetic, whereas this spectrogram was collected from an actual experiment.

Actual data

$\endgroup$
  • 3
    $\begingroup$ Attenuation relative to what? Bulk attenuation over the entire sliding window period, or how the attenuation varies over the time of the window? What's the motivation for using a DFT? Do you need to simultaneously analyze multiple signals separated in frequency, or is $s[t]$ assumed to contain a single signal of interest? How would you mathematically define the attenuation coefficient that you seek? $\endgroup$ – Jason R Aug 15 '12 at 12:58
  • $\begingroup$ Jason R: Thank you; I've now updated the question to add additional information. $\endgroup$ – Nicholas Kinar Aug 15 '12 at 15:12
  • 2
    $\begingroup$ I'll again ask why you plan to use a DFT. Based on the information in your question, it seems like all you want to do is estimate the average power level of the signal over time (and then normalize that value with respect to some reference). This would be a common operation for something like an automatic gain-control loop for a communication receiver. It's not clear why you would need a DFT to do this. Another question: is the signal of interest expected to be constant-envelope, or does its envelope naturally vary over time? $\endgroup$ – Jason R Aug 15 '12 at 17:47
  • $\begingroup$ @JasonR: Maybe a sliding DFT is not really required in this problem. The average power level of the signal is an interesting idea, and I think this would work well. How would I do this in the time domain? Could you describe an algorithm or point me to a reference? The envelope of the signal varies naturally over time, and it does not have a constant envelope. $\endgroup$ – Nicholas Kinar Aug 15 '12 at 18:06
  • $\begingroup$ I've now explicitly added the angular frequency to the equation. Maybe this helps to rationalize why frequency-domain methods are required? $\endgroup$ – Nicholas Kinar Aug 15 '12 at 18:13
3
$\begingroup$

From your question and comments, it looks like what you want to extract is the envelope of a signal.

A few things are still not clear:

  • Do you have any prior knowledge about the shape of this envelope (looks like it might be an exponential in your case)?
  • What is the signal "attenuated" by this envelope. Something complex like music? A pure sine-wave?
  • What are the relative "scale" of the signals. Is the carrier period several orders of magnitude lower than the constant time of the envelope? Or just one order of magnitude lower?

Some leads:

  • As @JasonR recommended, Compute signal power (or maximum absolute value) over sliding, overlapping, windows of N samples, where N is an order of magnitude greater than the period of your signal. If necessary, low-pass filter. If your goal is to get a single time constant (assuming exponential decay), take the log of the values and fit to a straight line.
  • Demodulation techniques. Take the absolute value of your signal and low-pass filter - optionally after band-pass filtering to select a frequency band of interest. Exactly how AM radio works! This works well when the envelope is relatively slow (several orders of magnitudes) compared with the carrier.
  • Parametric techniques. If your signal takes the form $\Re (\alpha z^n)$ (exponential damped sine wave) or $\Re(\sum_p \alpha_p z_p^n)$ (sum of exponentially damped sine waves) plus some white noise, where $\alpha$ is a complex number carrying the phase/amplitude information and $z$ a complex number carrying the sine wave period/exponential decay constant information, there are parametric techniques (ESPRIT, MUSIC) to get least square estimates of $z$. These techniques are particularly efficient when it comes to discriminating components in sums of signals. If you have a 100 Hz tone with a 1s exponential decay, and a 101 Hz tone with a 1.5s exponential decay added together, you'll recover these parameters provided noise is low-enough (while a naive DFT would have a hard time discriminating the two nearby sine waves). The downside is that your signal must conform to the chosen model for this to work.
$\endgroup$
  • 2
    $\begingroup$ In the form you have formulated it, the problem is underdetermined. The reason is that given an input like this: i.stack.imgur.com/CYPVg.png, what would make me say that it is unattenuated? Wouldn't it be possible that it would be indeed an attenuated version of a signal which originally had a lot of energy in the band affected by the attenuation. It's like taking a signal and asking "recover the impulse response of the filter through which this signal has signal has been filtered". You can't solve that without a prior model of the input signal. $\endgroup$ – pichenettes Aug 16 '12 at 22:34
  • 1
    $\begingroup$ To turn this into a determined problem, there are two questions worth asking: Do you have access to both an "original" and "attenuated" signal (the problem being akin to system-identification - fitting the ratio of the two to your time-varying kernel model)? Or at least can you make some assumptions about what an attenuated signal looks like? $\endgroup$ – pichenettes Aug 16 '12 at 22:37
  • 1
    $\begingroup$ My gut feeling about this would be a 2D flavor of cepstral analysis. You're looking at the product (in the Gabor domain) of two things. Take the log and it becomes a sum. One of them is slow-moving (the filter kernel), the other one is fast-moving (the "sponge"-like pattern of the signal), so they are disjoint in the quefrency domain. So try one more level of Gabor analysis on your images. One corner of the resulting 2D image might be the contribution of your Kernel, another corner might be the contribution of your original signal. $\endgroup$ – pichenettes Aug 16 '12 at 22:46
  • 1
    $\begingroup$ Another naive question: on your image: i.stack.imgur.com/iRK9u.png, I see a "blue banana". Is that a consequence of your attenuated data being synthetic - obtained by filtering of real data - (on real signals this would be filled by the same "sponge"-like background noise pattern we can see in the upper right corner). Or do we actually see such big dips in the spectrograms of signals in which attenuation is present? The synthetic data you posted is helpful, but it's still not clear to me what your actual input signal(s) is(are) and look(s) like? $\endgroup$ – pichenettes Aug 16 '12 at 22:57
  • 2
    $\begingroup$ Could you tell more about the underlying process behind this? Am I right to assume that you send a burst of narrow-band noise (4-20 Hz) - the vertical line at 0.4s being the transient due to switching the source on - into something that affects this burst on the time/frequency? Is it true to say that your "original" signal, even if not known, can be accurately described as a band of noise of constant of amplitude with a switch-on transient? $\endgroup$ – pichenettes Aug 16 '12 at 23:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.