Reply by Fred Marshall December 12, 20052005-12-12
<merlin.jiang1978@gmail.com> wrote in message 
news:1134383116.910818.30610@g43g2000cwa.googlegroups.com...
> Hello Fred, > > At first I was surprised that someone would tell me about transient > response for my question. But now I know that I made a mistake that I > used a bad example. > > My purpose is that if I have two input sequences, > s1 = [1 1 1 1 ... 1 1 1 10 10 10 ... 10 10 10 10] and > s2 = [1 1 1 1 ... 1 1 1 10 1 1 ... 1 1 1 1], > is there anything I can say about the rough effects of the two filters, > h1 and h2, on them? > > According to Tim's words, I can imagine: the differentiator in h1 does > detect the velocity, and the 2-point averaging pulls down the peak of > the passband by a factor of 2. h1 detects the velocity of s2 when the > three samples are [1 1 10] and [10 1 1] and nothing else. I think it > might be what I want: to express filtering in everyday words. (Thank > you Tim) > > However, now I'm more interested in your mentioning of the matched > filter. Can you please say more about why? >
Well, I wasn't really clear what you wanted to accomplish. A matched filter will do a good job of creating an output in which you might more readily detect the presence of the signal of interest - what the filter is matched to. I certainly agree with Jim that subtracting the constant "1.0" out of the sequences will allow a more direct evaluation .. well, unless the signals you're dealing with all have dc components to them in which case you might like to look at the difference of the filter output with that term and without it. Ignoring transients now: Your filters h1=[-1 0 1] and h2=[-1 2 -1] There are some things we can say about these filters by inspection: The sum of the coefficients is zero. This is the same as the dc response so the dc response is zero. h1 computes the difference between two samples that are 2 sample intervals apart. Another way to describe it is that it's a differentiator over fs/2. So, it's a differencer and as Tim points out can be realized as a cascade of a simple differentiator and a simple 2-point averager. It's also a highpass filter and, as above, has a zero at f=0. h2 would tend to measure the distance that a sample is above the "background". So, it gives a transient in response to a step and it gives a sharp peak in response to a unit sample. It's also a highpass filter and, as above, has a zero at f=0. The example of a matched filter is interesting if you are trying to detect a known signal in noise. A matched filter computes the convolution of the signal with a time-reversed replica. In the case of the second signal, a unit sample, the result is a single nonzero sample without the negative precusor and trailing edge caused by the h2 filter. In the case of the first signal, a step, the result is a rather broad peak. So, it gets back to what you're wanting to do. Fred
Reply by December 12, 20052005-12-12
Hi Jim,

That's cool. It's so vague while I'm still looking at it from one side,
but it suddenly becomes so obvious once I start to look at it from the
other side. It is described in the first few chapters in almost every
book, however I just didn't come up with it. This is a big lesson.
Thank you, Jim :)

Sincerely,
MJ

Reply by jim December 12, 20052005-12-12

merlin.jiang1978@gmail.com wrote:
> > Hello Fred, > > At first I was surprised that someone would tell me about transient > response for my question. But now I know that I made a mistake that I > used a bad example. > > My purpose is that if I have two input sequences, > s1 = [1 1 1 1 ... 1 1 1 10 10 10 ... 10 10 10 10] and > s2 = [1 1 1 1 ... 1 1 1 10 1 1 ... 1 1 1 1], > is there anything I can say about the rough effects of the two filters, > h1 and h2, on them? >
I would look at it the other way around. What are the effects of the 2 sequences on a filter. The s1 sequence will give you the step response of the filter. The s2 sequence will give you the impulse response of any filter you use. To see this more clearly you may want to adjust the gain and bias. If you subtract 1 and divide by 9 for each value in the input (or output) it may be more useful for what you are attempting. That is to say, you nay want to change the sequences to: s1=[....0 0 0 1 1 1 1.....] s2=[....0 0 0 1 0 0 0.....] -jim
> According to Tim's words, I can imagine: the differentiator in h1 does > detect the velocity, and the 2-point averaging pulls down the peak of > the passband by a factor of 2. h1 detects the velocity of s2 when the > three samples are [1 1 10] and [10 1 1] and nothing else. I think it > might be what I want: to express filtering in everyday words. (Thank > you Tim) > > However, now I'm more interested in your mentioning of the matched > filter. Can you please say more about why? > > Err... And I should have said DTFT instead of DFT in my original post. > I saw how people argued over it and the least thing I can do is to use > the right term in the right place. > > Thank you :-) > > Sincerely, > MJ
----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==---- http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups ----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Reply by December 12, 20052005-12-12
Hello Fred,

At first I was surprised that someone would tell me about transient
response for my question. But now I know that I made a mistake that I
used a bad example.

My purpose is that if I have two input sequences,
s1 = [1 1 1 1 ... 1 1 1 10 10 10 ... 10 10 10 10] and
s2 = [1 1 1 1 ... 1 1 1 10  1  1 ... 1 1 1 1],
is there anything I can say about the rough effects of the two filters,
h1 and h2, on them?

According to Tim's words, I can imagine: the differentiator in h1 does
detect the velocity, and the 2-point averaging pulls down the peak of
the passband by a factor of 2. h1 detects the velocity of s2 when the
three samples are [1 1 10] and [10 1 1] and nothing else. I think it
might be what I want: to express filtering in everyday words. (Thank
you Tim)

However, now I'm more interested in your mentioning of the matched
filter. Can you please say more about why?

Err... And I should have said DTFT instead of DFT in my original post.
I saw how people argued over it and the least thing I can do is to use
the right term in the right place.

Thank you :-)

Sincerely,
MJ

Reply by Tim Wescott December 7, 20052005-12-07
merlin.jiang1978@gmail.com wrote:

> Hello, > > I am thinking about a question about how to figure out whether a linear > filter really filters out anything against a particular sequence (or > any sequence). Here I don't want to compute w/ convolution, but I don't > know if it is possible to think in a convolution way for my problem. > > For example, I might have 2 filters h1 and h2,where > h1 = [-1 0 1], > h2 = [-1 2 -1] > > Their magnitude responses look different, yes. One has its peak at 1/4 > pi and the other at 1/2 pi. However, I shall want to get more feeling > for what they will do to the following two exemplary sequences: > s1 = [1 1 10 10] > s2 = [1 10 1 1] > > Based on my past experiences of analyzing w/ DFT, I know that s1 > possesses more strong freq. components than s2, which only has a single > cycle of the highest frequency signal. Therefore, if s1 is fed into the > filter of h1, it will have more stronger magnitude response at the > "edge" than s2. On the other hand, the edge in s2 can be filters out > with the filter of h2, but there will be nothing if I use h1.
You would do well to study the z transform a little bit. You would quickly see that h1 cascades a differentiator with a 2-point running average, while h2 cascades two differentiators (it's a double differentiator, in other words). As such h1 detects velocity, but has it's higher-frequency responses filtered out. On the other hand h2 detects acceleration with no other filtering at all.
> > I don't know if my English is good enough to make my point clear. But > I'm sure that there must be more insights I can have when looking at a > linear filter and a sequence.
_Don't_ apologize for your English, unless we start responding to you in Chinese (I assume that's your native tongue from your name). _You_ can talk about complex DSP issues in English; All _I_ know about Chinese is that it's possible to make really stupid puns about your mother's horse smoking marijuana -- and I don't even know if they work with anyone other than western students of Chinese.
> > Any comment or reference will be equally nice for me. Thank you for > your reading :) > > MJ >
I have a web page on the z transform; you're not really in the target audience but you may find it useful: http://www.wescottdesign.com/articles/zTransform/z-transforms.html -- Tim Wescott Wescott Design Services http://www.wescottdesign.com
Reply by Fred Marshall December 7, 20052005-12-07
<merlin.jiang1978@gmail.com> wrote in message 
news:1133966712.071970.232300@z14g2000cwz.googlegroups.com...
> Hello, > > I am thinking about a question about how to figure out whether a linear > filter really filters out anything against a particular sequence (or > any sequence). Here I don't want to compute w/ convolution, but I don't > know if it is possible to think in a convolution way for my problem. > > For example, I might have 2 filters h1 and h2,where > h1 = [-1 0 1], > h2 = [-1 2 -1] > > Their magnitude responses look different, yes. One has its peak at 1/4 > pi and the other at 1/2 pi. However, I shall want to get more feeling > for what they will do to the following two exemplary sequences: > s1 = [1 1 10 10] > s2 = [1 10 1 1] > > Based on my past experiences of analyzing w/ DFT, I know that s1 > possesses more strong freq. components than s2, which only has a single > cycle of the highest frequency signal. Therefore, if s1 is fed into the > filter of h1, it will have more stronger magnitude response at the > "edge" than s2. On the other hand, the edge in s2 can be filters out > with the filter of h2, but there will be nothing if I use h1. > > I don't know if my English is good enough to make my point clear. But > I'm sure that there must be more insights I can have when looking at a > linear filter and a sequence. > > Any comment or reference will be equally nice for me. Thank you for > your reading :)
MJ, It seems to me that you want to consider a couple of "standard" things. First, both filters have a length of 3 and a transient response of 2. Therefore you won't have steady state response until the third sample is input. Second, the sequences you're applying have length 4. So, there will only be two samples at the output that are not in the beginning or ending transients. How much can you infer from only two samples? Not much! And talking about frequency response doesn't make a lot of sense with these input sequences. Of course, that doesn't mean that the filter outputs for certain input sequences isn't interesting. In fact, with 4-element binary input sequences, there are only 16 possible inputs and one could compute the two stable samples for each one and rank them according to energy: Consider scaling s1 and s2 so that they are binary. s1=[0 0 1 1] s2=[0 1 0 0] Next, consider the idea of a "matched filter". A matched filter is implemented as a convolution of the time-reversed version of the expected signal with the signal being tested. So, if the signal of interest is [1 1 10 10] then the matched filter for convolution purposes would be [10 10 1 1] The results using s1 and s2 above would be: 10 20 111 202 111 20 10 and 1 11 21 103 21 11 1 Note that the output sequences are of length 4 + 4 -1 = 7. The first three samples are transient. The last three samples are transient. The middle sample is the only steady state output - if one can even talk about "steady state" in a situation like this. Anyway, it is also the peak output. Also, if you convolve the modified s1 and s2 with all possible combinations of 4-element binary vectors you will find that there are lots of outputs with higher total energy and that the "matched" outputs are the most "peaked" as in [ 0 0 0 1 0 0 0] for the modified s2. In fact, there is only *one* output that looks like the matched output. The other matched case is [ 0 0 1 2 1 0 0] for the modified s1. I don't really know what you mean by "filters out anything" in this context - it appears you're using steady state frequency analysis terminology. The sequences are too short to be in that context. Fred
Reply by December 7, 20052005-12-07
Hello,

I am thinking about a question about how to figure out whether a linear
filter really filters out anything against a particular sequence (or
any sequence). Here I don't want to compute w/ convolution, but I don't
know if it is possible to think in a convolution way for my problem.

For example, I might have 2 filters h1 and h2,where
h1 = [-1 0 1],
h2 = [-1 2 -1]

Their magnitude responses look different, yes. One has its peak at 1/4
pi and the other at 1/2 pi. However, I shall want to get more feeling
for what they will do to the following two exemplary sequences:
s1 = [1 1 10 10]
s2 = [1 10 1 1]

Based on my past experiences of analyzing w/ DFT, I know that s1
possesses more strong freq. components than s2, which only has a single
cycle of the highest frequency signal. Therefore, if s1 is fed into the
filter of h1, it will have more stronger magnitude response at the
"edge" than s2. On the other hand, the edge in s2 can be filters out
with the filter of h2, but there will be nothing if I use h1.

I don't know if my English is good enough to make my point clear. But
I'm sure that there must be more insights I can have when looking at a
linear filter and a sequence.

Any comment or reference will be equally nice for me. Thank you for
your reading :)

MJ