Sign in

username:

password:



Not a member?

Search compdsp



Search tips

comp.dsp by Keywords

Adaptive Filter | ADPCM | ADSP | ADSP-2181 | Aliasing | AMR | Anti-Aliasing | ARMA | Autocorrelation | AutoCovariance | Beamforming | Bessel | Blackfin | Butterworth | C6713 | CCS | Chebyshev | CIC Filter | Circular Convolution | Code Composer Studio | Comb Filter | Compression | Convolution | Cross Correlation | DCT | Decimation | Deconvolution | Demodulation | DM642 | DSP Boards | DSP/BIOS | DTMF | Echo Cancellation | Equalization | Equalizer | ETSI | EZLITE (Ez-kit Lite) | FFT | FFTW | FIR Filter | Fixed Point | FSK | G.711 | G.723 | G.729 | Gaussian Noise | Goertzel | GPIO | Hilbert Transform | IFFT | IIR Filter | Interpolation | Invariance | JTAG | Kalman | Laplace Transform | Levinson | LPC | McBSP | MIPS | Modulation | MPEG | Multirate | Notch Filter | Nyquist | OFDM | Oversampling | Pink Noise | Pitch | PLL | Polyphase | QAM | QDMA | Quantization | Quantizer | Radar | Random Noise | Reed Solomon | Remez | Resampling | RTDX | Sampling | Sharc | TI C6711 | Undersampling | Viterbi | Wavelets | White Noise | Wiener Filter | Windowing | XDS510PP | Z Transform

Ads

Discussion Groups

Free Online Books

See Also

Embedded SystemsFPGAElectronics

Discussion Groups | Comp.DSP | Help needed with legacy C++ filter code

There are 5 messages in this thread.

You are currently looking at messages 0 to 5.


Help needed with legacy C++ filter code - BCC - 2004-11-03 12:57:00

Hi,

Can anyone tell me what this code means, or what kind of filter it may 
be representing?

const double	std_spike_sym_delta[] = {-4, +4, +1, 0, -1, -4, +4};
const int	std_spike_sym_width[] = {1, 1, 2, 2, 2, 1, 1};
const int	std_spike_body_width = 8;

// +2      *.*
// +1     .   .
//  0  * *     * *
// -1  . .     . .
// -2  . .     . .
// -3   .       .
// -4   *       *

We have a problem where a filter in some legacy code is being applied to 
some mass spec data, and after this spike filter is applied the local 
maxima are all shifted to the low mass by 1-6 time points (indexes).

The actual code is too big to post but I was hoping someone could clue 
me in or suggest some online resources that might be useful.

Thanks, and if more info is needed, please let me know what.

Bryan
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Help needed with legacy C++ filter code - Jerry Avins - 2004-11-03 14:20:00



BCC wrote:

> Hi,
> 
> Can anyone tell me what this code means, or what kind of filter it may
> be representing?
> 
> const double    std_spike_sym_delta[] = {-4, +4, +1, 0, -1, -4, +4};
> const int    std_spike_sym_width[] = {1, 1, 2, 2, 2, 1, 1};
> const int    std_spike_body_width = 8;
> 
> // +2      *.*
> // +1     .   .
> //  0  * *     * *
> // -1  . .     . .
> // -2  . .     . .
> // -3   .       .
> // -4   *       *
> 
> We have a problem where a filter in some legacy code is being applied to
> some mass spec data, and after this spike filter is applied the local
> maxima are all shifted to the low mass by 1-6 time points (indexes).
> 
> The actual code is too big to post but I was hoping someone could clue
> me in or suggest some online resources that might be useful.
> 
> Thanks, and if more info is needed, please let me know what.
> 
> Bryan

Bryan,

It's impossible to tell from just the coefficients, and the illustration
is only vaguely suggestive. (Is the scale linear, logarithmic, or what?)
The names are probably more informative than anything else you've
posted. For the little it's worth, I'll guess that it's a deconvolution
filter to sharpen up the spikes, allowing them to be better localized in
time. If the filter is done right, the shifted data are the correct
result. Can you calibrate with a pure sample of known mass?

Deconvolution can sound like a scary process. How can a filter
accomplish it? Briefly, every system has an impulse response; that is,
its response to a pulse so short that a shorter one of the same energy
would have the same effect.

When any signal is applied to the system, its response to the signal is
the (linear) convolution of the signal and the system's impulse
response, muddling it a bit. Deconvolution amounts to unmuddling.

You can think of the sound coming out of a barrel when you talk into it
as the convolution of your voice and the barrel's impulse response. You
can also think of the barrel as a modifier of the frequencies in your
voice, emphasizing some, diminishing others, and generally altering
their phases. Is the barrel a convolver or a filter? Yes. Which? It's
whichever way you want to think about it. In a mass spec, it's called
deconvolution. In a transmission line, it's called equalization. The
reasons for the difference are mostly historic IMHO, but have something
to do with how the data needed for design are collected.

Jerry
-- 
Engineering is the art of making what you want from things you can get.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Help needed with legacy C++ filter code - BCC - 2004-11-03 16:49:00

Jerry Avins wrote:
> BCC wrote:
> 
> 
>>Hi,
>>
>>Can anyone tell me what this code means, or what kind of filter it may
>>be representing?
>>
>>const double    std_spike_sym_delta[] = {-4, +4, +1, 0, -1, -4, +4};
>>const int    std_spike_sym_width[] = {1, 1, 2, 2, 2, 1, 1};
>>const int    std_spike_body_width = 8;
>>
>>// +2      *.*
>>// +1     .   .
>>//  0  * *     * *
>>// -1  . .     . .
>>// -2  . .     . .
>>// -3   .       .
>>// -4   *       *
>>
>>We have a problem where a filter in some legacy code is being applied to
>>some mass spec data, and after this spike filter is applied the local
>>maxima are all shifted to the low mass by 1-6 time points (indexes).
>>
>>The actual code is too big to post but I was hoping someone could clue
>>me in or suggest some online resources that might be useful.
>>
>>Thanks, and if more info is needed, please let me know what.
>>
>>Bryan
> 
> 
> Bryan,
> 
> It's impossible to tell from just the coefficients, and the illustration
> is only vaguely suggestive. (Is the scale linear, logarithmic, or what?)
> The names are probably more informative than anything else you've
> posted. For the little it's worth, I'll guess that it's a deconvolution
> filter to sharpen up the spikes, allowing them to be better localized in
> time. If the filter is done right, the shifted data are the correct
> result. Can you calibrate with a pure sample of known mass?
> 
> Deconvolution can sound like a scary process. How can a filter
> accomplish it? Briefly, every system has an impulse response; that is,
> its response to a pulse so short that a shorter one of the same energy
> would have the same effect.
> 
> When any signal is applied to the system, its response to the signal is
> the (linear) convolution of the signal and the system's impulse
> response, muddling it a bit. Deconvolution amounts to unmuddling.
> 
> You can think of the sound coming out of a barrel when you talk into it
> as the convolution of your voice and the barrel's impulse response. You
> can also think of the barrel as a modifier of the frequencies in your
> voice, emphasizing some, diminishing others, and generally altering
> their phases. Is the barrel a convolver or a filter? Yes. Which? It's
> whichever way you want to think about it. In a mass spec, it's called
> deconvolution. In a transmission line, it's called equalization. The
> reasons for the difference are mostly historic IMHO, but have something
> to do with how the data needed for design are collected.
> 
> Jerry

Hmm, thanks for the info Jerry.  I suppose the code could be some sort 
of deconvolution algorithm... although I was under the impression that 
it was doing more of a smoothing.

As I understand it, when a signal is generated, in some cases (like ours 
I think) it is desireable to smooth it or apply a gaussian in order to 
determine the local maxima more easily.  Too many local maxima from a 
'rough' signal can make this difficult.  So I suspect this is a 
smoothing filter... but Im not sure.  The data after filtering looks 
like a second derivative of the original, for what thats worth.

In my case, we want to find the correct signal centers.  I do indeed 
calibrate to known masses, but then after that it is necessary with the 
technology to do an internal recalibration.  We have expected masses, 
and we correlate these with detected signals.  So for our recalibration 
to work properly, we -must- have the correct signal centers because we 
are extrapolating in the high and low mass ranges.

Maybe deconvoluting and smoothing are synonomous?  At any rate, we are 
stumped with this.

Thanks,
B
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Help needed with legacy C++ filter code - Jerry Avins - 2004-11-03 20:49:00

BCC wrote:

  ...

> Hmm, thanks for the info Jerry.  I suppose the code could be some sort
> of deconvolution algorithm... although I was under the impression that
> it was doing more of a smoothing.
> 
> As I understand it, when a signal is generated, in some cases (like ours
> I think) it is desireable to smooth it or apply a gaussian in order to
> determine the local maxima more easily.  Too many local maxima from a
> 'rough' signal can make this difficult.  So I suspect this is a
> smoothing filter... but Im not sure.  The data after filtering looks
> like a second derivative of the original, for what thats worth.

Smoothing might be a sensible approach, but differentiation doesn't
smooth; quite the opposite.

> In my case, we want to find the correct signal centers.  I do indeed
> calibrate to known masses, but then after that it is necessary with the
> technology to do an internal recalibration.  We have expected masses,
> and we correlate these with detected signals.  So for our recalibration
> to work properly, we -must- have the correct signal centers because we
> are extrapolating in the high and low mass ranges.

Extrapolating is always iffy, requiring a theoretical basis. If all the
masses in the middle ranges that don't need extrapolating behave the
same way, or according to the same curve, then you're likely safe.

> Maybe deconvoluting and smoothing are synonomous?

No.

> At any rate, we are stumped with this.

There's an online book at http://www.dspguide.com/. Read page 300 (in
Chapter 17. You could still be stumped, but you might know enough to
know why. :-)

Jerry
-- 
Engineering is the art of making what you want from things you can get.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Help needed with legacy C++ filter code - BCC - 2004-11-04 01:07:00

Jerry Avins wrote:
> BCC wrote:
> 
>   ...
> 
> 
>>Hmm, thanks for the info Jerry.  I suppose the code could be some sort
>>of deconvolution algorithm... although I was under the impression that
>>it was doing more of a smoothing.
>>
>>As I understand it, when a signal is generated, in some cases (like ours
>>I think) it is desireable to smooth it or apply a gaussian in order to
>>determine the local maxima more easily.  Too many local maxima from a
>>'rough' signal can make this difficult.  So I suspect this is a
>>smoothing filter... but Im not sure.  The data after filtering looks
>>like a second derivative of the original, for what thats worth.
> 
> 
> Smoothing might be a sensible approach, but differentiation doesn't
> smooth; quite the opposite.
> 
> 
>>In my case, we want to find the correct signal centers.  I do indeed
>>calibrate to known masses, but then after that it is necessary with the
>>technology to do an internal recalibration.  We have expected masses,
>>and we correlate these with detected signals.  So for our recalibration
>>to work properly, we -must- have the correct signal centers because we
>>are extrapolating in the high and low mass ranges.
> 
> 
> Extrapolating is always iffy, requiring a theoretical basis. If all the
> masses in the middle ranges that don't need extrapolating behave the
> same way, or according to the same curve, then you're likely safe.
> 
> 
>>Maybe deconvoluting and smoothing are synonomous?
> 
> 
> No.
> 
> 
>>At any rate, we are stumped with this.
> 
> 
> There's an online book at http://www.dspguide.com/. Read page 300 (in
> Chapter 17. You could still be stumped, but you might know enough to
> know why. :-)
> 
> Jerry

Ah, excellent link!  I will check this out, thanks for the help!

Bryan
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.