Forums

Cascading filters with different sampling frequencies.

Started by Unknown April 27, 2005
Hello,

I have two filters, one designed for a sampling frequency of 16kHz and
the other for a sampling frequency of 8kHz. The type and kind of
filters (FIR/IIR, HP/LP/Notch) is irrelevant. I need to plot the
overall transfer function of this cascaded pair. What changes do I have
to make (in the 8kHz filter, I am assuming), if any at all, in order to
cascade the two filters?

Pointers to any literature that deals with such issues will be greatly
appreciated. 

Thanks,
Tanmay.

tanmay.zargar@gmail.com wrote:
> Hello, > > I have two filters, one designed for a sampling frequency of 16kHz and > the other for a sampling frequency of 8kHz. The type and kind of > filters (FIR/IIR, HP/LP/Notch) is irrelevant. I need to plot the > overall transfer function of this cascaded pair. What changes do I have > to make (in the 8kHz filter, I am assuming), if any at all, in order to > cascade the two filters? > > Pointers to any literature that deals with such issues will be greatly > appreciated. > > Thanks, > Tanmay. >
If this is a practical exercise, multiply the two transfer functions to obtain the overall response, and design a single filter to achieve that response. It's not much more work than designing a 16-KHz version of the 8-KHz filter, and the result will be more computationally efficient. If the originals are non-overlapping band-pass filters, the computational efficiency will be very high indeed! Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
Thanks for the reply Jerry. However, I am not looking to combine the
two filters.

I came across some DSP stuff relating to my earlier question that I
wanted to bounce off this group. Well here is what I saw -

Filter F1 has sampling frequency Fs. Frequency response is H1(z).
Filter F2 has sampling frequency Fs/2. Frequency response is H2(z).

Overall Frequency Response of the cascade configuration is
HI(z)*H2(z^2) (* denotes multiplication and not convolution). Also note
the the Frequency Response of the filter F2 in the overall response. So
I want to know how this relation of the overall frequency response is
established.

Any ideas/pointers?

T.

tanmay.zargar@gmail.com wrote:
> Thanks for the reply Jerry. However, I am not looking to combine the > two filters. > > I came across some DSP stuff relating to my earlier question that I > wanted to bounce off this group. Well here is what I saw - > > Filter F1 has sampling frequency Fs. Frequency response is H1(z). > Filter F2 has sampling frequency Fs/2. Frequency response is H2(z). > > Overall Frequency Response of the cascade configuration is > HI(z)*H2(z^2) (* denotes multiplication and not convolution). Also note > the the Frequency Response of the filter F2 in the overall response. So > I want to know how this relation of the overall frequency response is > established. > > Any ideas/pointers?
Not from me. I assume that your HI was meant to be H1. H2's z^2 term is probably an indication that the filter was used unaltered at the new rate. Those are only leads for you to chase down, not answers. Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
<tanmay.zargar@gmail.com> wrote in message 
news:1114619440.941888.99810@g14g2000cwa.googlegroups.com...
> Thanks for the reply Jerry. However, I am not looking to combine the > two filters. > > I came across some DSP stuff relating to my earlier question that I > wanted to bounce off this group. Well here is what I saw - > > Filter F1 has sampling frequency Fs. Frequency response is H1(z). > Filter F2 has sampling frequency Fs/2. Frequency response is H2(z). > > Overall Frequency Response of the cascade configuration is > HI(z)*H2(z^2) (* denotes multiplication and not convolution). Also note > the the Frequency Response of the filter F2 in the overall response. So > I want to know how this relation of the overall frequency response is > established. > > Any ideas/pointers?
The frequency response of H2 has to be repeated over Fs before you do the multiply. Otherwise you won't get the necessary result. So, let us say that H1 has a span of Fs and let's assume that it's being computed on a discrete set of points of length N. Let us say that H2 has a span of Fs/2 and let's assume that it's being computed on a discrete set of points of length N/2. So, you can't multiply arrays point-by-point unless they are of the same length. So, you have to create an array out of H2 that has length N by repeating H2 as in [H2 H2]. Then you can do the multiply and will the the correct result. Fred
<tanmay.zargar@gmail.com> wrote in message 
news:1114619440.941888.99810@g14g2000cwa.googlegroups.com...
> Thanks for the reply Jerry. However, I am not looking to combine the > two filters. > > I came across some DSP stuff relating to my earlier question that I > wanted to bounce off this group. Well here is what I saw - > > Filter F1 has sampling frequency Fs. Frequency response is H1(z). > Filter F2 has sampling frequency Fs/2. Frequency response is H2(z). > > Overall Frequency Response of the cascade configuration is > HI(z)*H2(z^2) (* denotes multiplication and not convolution). Also note > the the Frequency Response of the filter F2 in the overall response. So > I want to know how this relation of the overall frequency response is > established.
The formula you give for the cascaded response indicates that F2 was converted to the Fs sampling rate by simply stuffing zeros between the coefficients, to give it the H2(z^2) response. Note the aliasing this causes -- H2(z^2) = H2((-z)^2. -- Matt
On 27 Apr 2005 09:30:40 -0700, tanmay.zargar@gmail.com wrote:

>Thanks for the reply Jerry. However, I am not looking to combine the >two filters.
Hi, I wonder what the word "combine" means. I'll bet you mean "cascade". This sure sounds like a homework problem, but it's such an interesting problem. I don't have a quick answer for you, but here are my "two cents."
>I came across some DSP stuff relating to my earlier question that I >wanted to bounce off this group. Well here is what I saw - > >Filter F1 has sampling frequency Fs. Frequency response is H1(z). >Filter F2 has sampling frequency Fs/2. Frequency response is H2(z).
Remember now, H1(z) and H2(z) are equations, polynomials, and the independent variable (z) is a continuous variable. So those equations are continuous functions. (At least I "think" it's OK to call them "functions.) Can't you just multiply the H1 polynomial and the H2 polynomial to get some "longer" polynomial that is the product of H1 and H2? That new polynomial describes the cascaded filters. I'm not sure what it means for two filters to "have two different sampling frequencies." I have a feeling that this "two different sampling frequencies" description is a professor's way of turning a simple problem into a more difficult problem. (I could be wrong though.)
>Overall Frequency Response of the cascade configuration is >HI(z)*H2(z^2) (* denotes multiplication and not convolution). Also note >the the Frequency Response of the filter F2 in the overall response. So >I want to know how this relation of the overall frequency response is >established.
I noticed that you wrote "H2(z^2)". What I've always thought "H2(z^2)" meant is every other (alternate) term in some H(z) z-transform polynomial. I've seen that "H2(z^2)" notation used to describe polyphase filters used in multirate systems. Tanmay, is your "problem" related to sample rate change (interpolation or decimation)? See ya', & Good Luck, [-Rick-]
tanmay.zargar@gmail.com wrote:
> Hello, > > I have two filters, one designed for a sampling frequency of 16kHz
and
> the other for a sampling frequency of 8kHz. The type and kind of > filters (FIR/IIR, HP/LP/Notch) is irrelevant. I need to plot the > overall transfer function of this cascaded pair. What changes do I
have
> to make (in the 8kHz filter, I am assuming), if any at all, in order
to
> cascade the two filters?
Hmmmm.... I don't like this question at all. You don't mention whether the filters are interrelated in any way, so I must assume they are not. In time domain: The 16 kHz filter is sampled twice as fast as the 8 kHz filter. How do you convolve the impulse responses? I don't know. In frequency domain: The sampling and nyquist frequencies are different. Unless explicitly stated that this can not happen, the below combination of frequency responses are troublesome [use fixed-width font]: ^ | | ______________ H2 ______________ | | | | | | | | | | | __|_ H1 _|_ __|_ _|_ | / | \ / | \ / | \ / | \ |/ | \ / | \|/ | \ / | \ +-----------------------+-----------------------+-----> 8 kHz 16 kHz wher H1 is the spectrum magnitude response of the 8 kHz filter and H2 is the spectrum magnitude response of the 16 kHz filter. I am not very happy with this rather peculiar interaction between the baseband of the 16 kHz filetr and the repeated, mirrored band of the 8 kHz filter. In short, I think the question is ill posed.
> Pointers to any literature that deals with such issues will be
greatly
> appreciated.
You have to specify some relation between the filters, like a multirate filter bank or subband filters, or something like that. As the question is posed, I don't like it. Rune
"Rick Lyons" <R.Lyons@_BOGUS_ieee.org> wrote in message 
news:4270b71a.574691484@news.sf.sbcglobal.net...
> On 27 Apr 2005 09:30:40 -0700, tanmay.zargar@gmail.com wrote: > >>Thanks for the reply Jerry. However, I am not looking to combine the >>two filters. > > Hi, > > I wonder what the word "combine" means. > I'll bet you mean "cascade". > > This sure sounds like a homework problem, but it's > such an interesting problem. > I don't have a quick answer for you, but here > are my "two cents." > >>I came across some DSP stuff relating to my earlier question that I >>wanted to bounce off this group. Well here is what I saw - >> >>Filter F1 has sampling frequency Fs. Frequency response is H1(z). >>Filter F2 has sampling frequency Fs/2. Frequency response is H2(z). > > Remember now, H1(z) and H2(z) are equations, > polynomials, and the independent variable (z) is > a continuous variable. > So those equations are continuous functions. > (At least I "think" it's OK to call them "functions.) > > Can't you just multiply the H1 polynomial and > the H2 polynomial to get some "longer" polynomial > that is the product of H1 and H2? That new polynomial > describes the cascaded filters. > > I'm not sure what it means for two filters to > "have two different sampling frequencies." > I have a feeling that this "two different > sampling frequencies" description is a professor's > way of turning a simple problem into a more > difficult problem. (I could be wrong though.) > >>Overall Frequency Response of the cascade configuration is >>HI(z)*H2(z^2) (* denotes multiplication and not convolution). Also note >>the the Frequency Response of the filter F2 in the overall response. So >>I want to know how this relation of the overall frequency response is >>established. > > I noticed that you wrote "H2(z^2)". What I've > always thought "H2(z^2)" meant is > every other (alternate) term in some > H(z) z-transform polynomial. I've seen that "H2(z^2)" > notation used to describe polyphase filters used in > multirate systems. > > Tanmay, is your "problem" related to sample rate > change (interpolation or decimation)? > > See ya', & Good Luck, > [-Rick-]
Good morning Rick! :-) Perhaps you are being rhetorical. But I couldn't resist: If the sampling rates, thus intervals, are different this means: There must be something that makes the "sample rates" of the filters different. Because, if the filters are simply defined as sets of coefficients, then they are sample interval / unit delay independent aren't they? The delay blocks could have any delay value - the samples being operated on could have been sampled at any arbitrary rate. H(z) normally implies a unit delay of 1 second corresponding to z^-1. So, if there's a filter where the unit delay is normalized to 1 second and another filter where the unit delay is, relatively, 2 seconds - how does one handle a cascade of them? One can't talk about cascading: an H1(z) saying the sample rate is 16kHz and another "H2(z)" saying the sample rate is 8kHz! That's because "z" isn't the same in the two. I think the simplest way is to treat the filter with 2-second unit delays as have 2 1-second delays per delay block. I think the OP stated that relationship appropriately and so did you with H(z^2) .... H(z^2) > H[z^-(1*2)] Oh shucks I'm *not* going to figger out whether we want to be using z or z^-1 here.... I think that z^-1 is the appropriate variable. Anyway, once that's done, then the issues of particular spectra, etc. come into play. But, the OP did say that he didn't care about that right now - simply: "what is the transfer function". In order to get the transfer function one has to express one filter as H(z) and the other as H(z^2) and I think that's all there is to it. That way the unit circles are of the same diameter if you want to look at it that way. Or, that way the sample rates of the filters are the "same". Fred
Dear all!

I have following the discussion below. Assume that we want cascade two 
filters n1(n) and h2(n) together where the last one operates on a higher 
sampling frequency, i.e h2(n) = h1(2n). Shouldn't it be possible transform 
these two two filter into frequency domain by N-points DFT

    H2(w) = DFT{h2(n)}

and

    H1(w) = DFT{h1(n)}

and then perfom a block-wise processing including IDFT (add and save or some 
else) for the following

    y(n) = IDFT{H1(w)H2(w)X(w)}.

In my mind we don't need to have different sampling frequencies becaus of 
the periodicity properities for the h2(n) in the frequency domain.

Is that correct?

Thanks all and all the best,
Michael N.

>>>Thanks for the reply Jerry. However, I am not looking to combine the >>>two filters. >> >> Hi, >> >> I wonder what the word "combine" means. >> I'll bet you mean "cascade". >> >> This sure sounds like a homework problem, but it's >> such an interesting problem. >> I don't have a quick answer for you, but here >> are my "two cents." >> >>>I came across some DSP stuff relating to my earlier question that I >>>wanted to bounce off this group. Well here is what I saw - >>> >>>Filter F1 has sampling frequency Fs. Frequency response is H1(z). >>>Filter F2 has sampling frequency Fs/2. Frequency response is H2(z). >> >> Remember now, H1(z) and H2(z) are equations, >> polynomials, and the independent variable (z) is >> a continuous variable. >> So those equations are continuous functions. >> (At least I "think" it's OK to call them "functions.) >> >> Can't you just multiply the H1 polynomial and >> the H2 polynomial to get some "longer" polynomial >> that is the product of H1 and H2? That new polynomial >> describes the cascaded filters. >> >> I'm not sure what it means for two filters to >> "have two different sampling frequencies." >> I have a feeling that this "two different >> sampling frequencies" description is a professor's >> way of turning a simple problem into a more >> difficult problem. (I could be wrong though.) >> >>>Overall Frequency Response of the cascade configuration is >>>HI(z)*H2(z^2) (* denotes multiplication and not convolution). Also note >>>the the Frequency Response of the filter F2 in the overall response. So >>>I want to know how this relation of the overall frequency response is >>>established. >> >> I noticed that you wrote "H2(z^2)". What I've >> always thought "H2(z^2)" meant is >> every other (alternate) term in some >> H(z) z-transform polynomial. I've seen that "H2(z^2)" >> notation used to describe polyphase filters used in >> multirate systems. >> >> Tanmay, is your "problem" related to sample rate >> change (interpolation or decimation)? >> >> See ya', & Good Luck, >> [-Rick-] > > Good morning Rick! :-) > > Perhaps you are being rhetorical. But I couldn't resist: > > If the sampling rates, thus intervals, are different this means: > > There must be something that makes the "sample rates" of the filters > different. Because, if the filters are simply defined as sets of > coefficients, then they are sample interval / unit delay independent > aren't they? The delay blocks could have any delay value - the samples > being operated on could have been sampled at any arbitrary rate. > > H(z) normally implies a unit delay of 1 second corresponding to z^-1. > So, if there's a filter where the unit delay is normalized to 1 second and > another filter where the unit delay is, relatively, 2 seconds - how does > one handle a cascade of them? > One can't talk about cascading: > an H1(z) saying the sample rate is 16kHz and another > "H2(z)" saying the sample rate is 8kHz! > That's because "z" isn't the same in the two. > > I think the simplest way is to treat the filter with 2-second unit delays > as have 2 1-second delays per delay block. I think the OP stated that > relationship appropriately and so did you with H(z^2) .... H(z^2) > > H[z^-(1*2)] > > Oh shucks I'm *not* going to figger out whether we want to be using z or > z^-1 here.... I think that z^-1 is the appropriate variable. > > Anyway, once that's done, then the issues of particular spectra, etc. come > into play. > But, the OP did say that he didn't care about that right now - simply: > "what is the transfer function". In order to get the transfer function > one has to express one filter as H(z) and the other as H(z^2) and I think > that's all there is to it. That way the unit circles are of the same > diameter if you want to look at it that way. Or, that way the sample > rates of the filters are the "same". > > Fred >