PDA

View Full Version : shrinking convolution remainders!


Jeremiah Smith
09-10-2003, 05:02 AM
this post is similar to previous posts but an effort has been made to
clarify and emphasize points; i'm new to dsp. A lot of the "notation" is
matlab.

i have an impluse response defined as follows:

h(t) = q(t) - q(t - p)

where 0<=t<N, and N = p + 1. p is some period value, 2<p<300 (for example),
and all
variables are integers. an example h function is given below. the function
q(t) is the unit impluse,
defined as q(t) = { ...,0,0,1,0,0,... } where I designate time zero as one
or
q( 0 ) = 1 and q( t ) = 0 when t IS NOT 0 as a typical practice.

I use the matlab function conv for convolution to apply the impulse
response, but make the length of the h vector/array
a suitable size. For example, with a period p value of 7, the h vector/array
would be:

h = [ 1, 0, 0, 0, 0, 0, 0, -1 ]

the purpose of the impluse response is to remove periodicities in a given
signal known to be composed of purely integer-periodic signals. In my
application, there can be zero signals or up to 6 mixed together. I call the
mixed signal m(t) and is essentually defined as:

m(t) = s0(t) + s1(t) + s2(t) + etc...

and each sumand signal for the mixed signal m has the following property:

s(t) = s(t - p)

I have been calling the filtered signal z and get it in matlab as follows:

z = conv( h, m )

This works great and filters the signal, but not the ideal way i am looking
for. Suppose that the length of the mixed signal m is 28 and there is only
ONE periodic signal s in the "mixture" where its period p = 7. That means
there will be 4 repetitions of the period in the "mixture" variable m. When
I get z via the conv function, I can clearly see where the period 7 "signal"
has been filtered out, as there are zeros. There is also what i call
'garbage' on the 'sides' of the array/vector, and I can only seem to use the
middle region of the z array/vector where the zeros are. If j = length(z),
the "garbage" spans from z( 1:p ) and from z( ( j-p ):j ). The other
elements of z is what i want, but it is shorter then the original length of
m.

In cases where there are, say two periodic signals mixed, the result of the
conv function portrays the same scenerio as in the above paragraph, but the
remaining "signal" in the region that is not the "garbage" regions is
periodic, but not the exact signal used to create the mixture m. In other
words, it's period is correct, matching the period of the proper mixed
signal that is supposed to be left, just the values themselves are
different. In my particular application, this is not important at all; I
only need to know the periods present, not what the actual values of each
periodic signal are. But it does bring me to main problem:

How can obtain more "non-garbage" from these operations? In my application,
I need to use about two or three periods worth of samples and no more. The
range of periods is very wide and I can unfortunately only detect the longer
periods via another and separate algorithm. Therefore, if i want to use only
2 or 3 of an arbitrary set of periods and can only detect the longest
periods first, the useable remainder of the convolution result becomes
shorter and shorter very quickly. The goal of the application is to detect a
periodicity and remove it in chunks that are no more then 3 of the longest
period possible.

Alexey Lukin had mentioned to use a IIR filter for more accurate "notches"
which i assume meant tighter bands of cut/gains of frequencies? I am aware
of the concept of an IIR filter but am unsure how to apply a IIR concept to
removing periods as the FIR implementation i have above( i think it is
FIR ). Are there any other methods to apply the basic idea of removing
periodicities from a the "mixture" m? Perhaps doing it in the frequency
domain solely instead of convolution? Any help would be greatly appreciated!

Thanks,
Jeremiah

Bernhard Holzmayer
09-10-2003, 08:39 AM
Hi Jeremiah,

maybe, I miss anything. However, if you can play with Matlab,
did you try to do this:
in the frequency domain, your periodicity should be found as a
distinct line. So:
FFT your signal (basically with Xtransform=fft(x))
find the range which represents your periodicity,
replace the values within this range by zeros,
do an inverse transform, and you'll have your signal with
the periodicity removed.

Bernhard


Jeremiah Smith wrote:

>
> this post is similar to previous posts but an effort has been made
> to clarify and emphasize points; i'm new to dsp. A lot of the
> "notation" is matlab.
>
> i have an impluse response defined as follows:
>
> h(t) = q(t) - q(t - p)
>
> where 0<=t<N, and N = p + 1. p is some period value, 2<p<300 (for
> example), and all
> variables are integers. an example h function is given below. the
> function q(t) is the unit impluse,
> defined as q(t) = { ...,0,0,1,0,0,... } where I designate time
> zero as one or
> q( 0 ) = 1 and q( t ) = 0 when t IS NOT 0 as a typical practice.
>
> I use the matlab function conv for convolution to apply the
> impulse response, but make the length of the h vector/array
> a suitable size. For example, with a period p value of 7, the h
> vector/array would be:
>
> h = [ 1, 0, 0, 0, 0, 0, 0, -1 ]
>
> the purpose of the impluse response is to remove periodicities in
> a given signal known to be composed of purely integer-periodic
> signals. In my application, there can be zero signals or up to 6
> mixed together. I call the mixed signal m(t) and is essentually
> defined as:
>
> m(t) = s0(t) + s1(t) + s2(t) + etc...
>
> and each sumand signal for the mixed signal m has the following
> property:
>
> s(t) = s(t - p)
>
> I have been calling the filtered signal z and get it in matlab as
> follows:
>
> z = conv( h, m )
>
> This works great and filters the signal, but not the ideal way i
> am looking for. Suppose that the length of the mixed signal m is
> 28 and there is only ONE periodic signal s in the "mixture" where
> its period p = 7. That means there will be 4 repetitions of the
> period in the "mixture" variable m. When I get z via the conv
> function, I can clearly see where the period 7 "signal" has been
> filtered out, as there are zeros. There is also what i call
> 'garbage' on the 'sides' of the array/vector, and I can only seem
> to use the middle region of the z array/vector where the zeros
> are. If j = length(z), the "garbage" spans from z( 1:p ) and from
> z( ( j-p ):j ). The other elements of z is what i want, but it is
> shorter then the original length of m.
>
> In cases where there are, say two periodic signals mixed, the
> result of the conv function portrays the same scenerio as in the
> above paragraph, but the remaining "signal" in the region that is
> not the "garbage" regions is periodic, but not the exact signal
> used to create the mixture m. In other words, it's period is
> correct, matching the period of the proper mixed signal that is
> supposed to be left, just the values themselves are different. In
> my particular application, this is not important at all; I only
> need to know the periods present, not what the actual values of
> each periodic signal are. But it does bring me to main problem:
>
> How can obtain more "non-garbage" from these operations? In my
> application, I need to use about two or three periods worth of
> samples and no more. The range of periods is very wide and I can
> unfortunately only detect the longer periods via another and
> separate algorithm. Therefore, if i want to use only 2 or 3 of an
> arbitrary set of periods and can only detect the longest periods
> first, the useable remainder of the convolution result becomes
> shorter and shorter very quickly. The goal of the application is
> to detect a periodicity and remove it in chunks that are no more
> then 3 of the longest period possible.
>
> Alexey Lukin had mentioned to use a IIR filter for more accurate
> "notches" which i assume meant tighter bands of cut/gains of
> frequencies? I am aware of the concept of an IIR filter but am
> unsure how to apply a IIR concept to removing periods as the FIR
> implementation i have above( i think it is FIR ). Are there any
> other methods to apply the basic idea of removing periodicities
> from a the "mixture" m? Perhaps doing it in the frequency domain
> solely instead of convolution? Any help would be greatly
> appreciated!
>
> Thanks,
> Jeremiah

--
before sending to the above email-address: