DSPRelated.com
Forums

decimate 4800 Hz downto 200 Hz??

Started by Elektro March 1, 2005
How can I find the best way to decimate a input signal with a sampling
frequency of 4800 Hz down to 200 Hz with a desired response of:



fp = 40 Hz

fs = 50 Hz

passband ripple 0.01 dB

stopband attenuation 144 dB



And I would be glad if i got some recommendation on some good books about
multi rate signal processing (a book with a lot of examples).


"Elektro" <student@telia.se> wrote in message
news:d0235e$7pm$1@domitilla.aioe.org...
> How can I find the best way to decimate a input signal with a sampling > frequency of 4800 Hz down to 200 Hz with a desired response of: > > > > fp = 40 Hz > > fs = 50 Hz > > passband ripple 0.01 dB > > stopband attenuation 144 dB > > > > And I would be glad if i got some recommendation on some good books about > multi rate signal processing (a book with a lot of examples). > >
Since im currently doing a project on CIC filters used for decimation in DAB, i would suggest look there! CIC's have various parameters with no multipliers for your frequency requirements. good luck Phill
Elektro wrote:
> How can I find the best way to decimate a input signal with a
sampling
> frequency of 4800 Hz down to 200 Hz with a desired response of: > > > > fp = 40 Hz > > fs = 50 Hz > > passband ripple 0.01 dB > > stopband attenuation 144 dB > > > > And I would be glad if i got some recommendation on some good books
about
> multi rate signal processing (a book with a lot of examples).
I think a good approach for this D=24 problem is to divide into two FIR stages. A simple explanation can be had in "Understanding DSP" by R. Lyons, 2nd edition. A new book on multirate DSP by Harris is out now, but that will take you much further afield than the problem you stated. John
"Elektro" <student@telia.se> wrote in message 
news:d0235e$7pm$1@domitilla.aioe.org...
> How can I find the best way to decimate a input signal with a sampling > frequency of 4800 Hz down to 200 Hz with a desired response of: > > > > fp = 40 Hz > > fs = 50 Hz > > passband ripple 0.01 dB > > stopband attenuation 144 dB
You didn't say if this is streaming data or a chunk. Anyway, ignoring that "detail", in concept you might: Halfband filter and decimate by 2. Repeat this 12 times using the same filter each time. Look at it in the frequency domain: When you halfband filter, the samples from fs/4 to 3fs/4 go to nearly zero. In order to decimate in time, the spectra are "overlapped" or contracted at the center (fs/2) so those zeros go away. Then, you filter again..... The whole idea is to get to a spectrum that's 1/24th the original. Or, you might do it in one step: Multiply in frequency using the response of a "real" lowpass filter design to limit the frequency to something under 100Hz. Then delete the zeros from 100Hz to 4700Hz. That is, contract the spectrum from N to N/24 points. Then IFFT. If the time array is large to begin with, then this will be an efficient way of doing it - believe it or not.... Fred
"Fred Marshall" <fmarshallx@remove_the_x.acm.org> wrote in message news:<E46dncnJo4G2ibjfRVn-sg@centurytel.net>...
> "Elektro" <student@telia.se> wrote in message > news:d0235e$7pm$1@domitilla.aioe.org... > > How can I find the best way to decimate a input signal with a sampling > > frequency of 4800 Hz down to 200 Hz with a desired response of: > > > > > > > > fp = 40 Hz > > > > fs = 50 Hz > > > > passband ripple 0.01 dB > > > > stopband attenuation 144 dB > > You didn't say if this is streaming data or a chunk. > > Anyway, ignoring that "detail", in concept you might: > Halfband filter and decimate by 2. > Repeat this 12 times using the same filter each time. > > Look at it in the frequency domain: > When you halfband filter, the samples from fs/4 to 3fs/4 go to nearly zero. > In order to decimate in time, the spectra are "overlapped" or contracted at > the center (fs/2) so those zeros go away. > Then, you filter again..... > The whole idea is to get to a spectrum that's 1/24th the original. > > Or, you might do it in one step: > Multiply in frequency using the response of a "real" lowpass filter design > to limit the frequency to something under 100Hz. > Then delete the zeros from 100Hz to 4700Hz. That is, contract the spectrum > from N to N/24 points. > Then IFFT. > > If the time array is large to begin with, then this will be an efficient way > of doing it - believe it or not.... > > Fred
Hi Fred, which is the advantage in using recursive half band filtering respect to the "conventional" approach of low-pass filtering with fp=40Hz and fs=50Hz and then decimating by a factor of 24? perhaps the drawback of - first filtering and then decimating - is that filter must work at a sample rate of 4800Hz. thanks. Jack
Elektro wrote:
> How can I find the best way to decimate a input signal with a sampling > frequency of 4800 Hz down to 200 Hz with a desired response of: > > > > fp = 40 Hz > > fs = 50 Hz > > passband ripple 0.01 dB > > stopband attenuation 144 dB >
Simple way: decimate first by 12 and then by 2. fs = 2; dp = 0.006; % Passband ripple ds = 10^(-144/20); % Stopband ripple wp = 40/(4800/2); % Passband edge ws = 50/(4800/2); % Stopband edge nFil = 3; % Number of filters M = 12; N = 2; edges(1, :) = [wp fs/M-ws] % edges(2, :) = [wp fs/(N*M)-ws] edges(3, :) = [wp ws]; % Band edges for H(z) ripples = [dp/nFil ds]; [order(1), fo(:, 1), mo1, w1] = remezord(edges(1, :), [1 0], ripples); [order(2), fo(:, 2), mo2, w2] = remezord(edges(2, :), [1 0], ripples, fs/M); [order(3), fo(:, 3), mo3, w3] = remezord(edges(3, :), [1 0], ripples, fs/(M*N)); H1 = remez(order(1), fo(:, 1), mo1, w1); H2 = remez(order(2), fo(:, 2), mo2, w2); H0 = remez(order(3), fo(:, 3), mo3, w3); nGridPoints = 2^15 w = linspace(0, pi, nGridPoints); W1 = freqz(H1, 1, w); W2 = freqz(H2, 1, M*w); W0 = freqz(H0, 1, M*N*w); plot(4800/2*w/pi, 20*log10(abs(W1.*W2.*W0))) axis([0 4800/2 -200 5]) xlabel('Frequency (Hz)') ylabel('Amplitude in dB') grid on > > > And I would be glad if i got some recommendation on some good books about > multi rate signal processing (a book with a lot of examples). > > Sanjit K. Mitra, Digital Signal Processing, A Computer-Based Approach, McGraw-Hill, 1998. E. C. Ifeachor and B. W. Jervis, Digital Signal Processing, A Practical Approach, Addison-Wesley, 1993. R. Ansari and B. Liu, Multirate signal processing, in Handbook for Digital Signal Processing, S. K. Mitra and J. F. Kaiser, Eds., chapter 14, pp. 981-1084. New York: John Wiley and Sons, 1993. N. J. Fliege, Multirate Digital Signal Processing", John Wiley and Sons", 1994. -- Juha
Juha <foo@bar.org> writes:
> [...] > Sanjit K. Mitra, Digital Signal Processing, A Computer-Based Approach, > McGraw-Hill, 1998.
I second this recommendation - an excellent text. -- Randy Yates Sony Ericsson Mobile Communications Research Triangle Park, NC, USA randy.yates@sonyericsson.com, 919-472-1124
Jack Ace wrote:
> "Fred Marshall" <fmarshallx@remove_the_x.acm.org> wrote in message news:<E46dncnJo4G2ibjfRVn-sg@centurytel.net>... > >>"Elektro" <student@telia.se> wrote in message >>news:d0235e$7pm$1@domitilla.aioe.org... >> >>>How can I find the best way to decimate a input signal with a sampling >>>frequency of 4800 Hz down to 200 Hz with a desired response of: >>> >>> >>> >>>fp = 40 Hz >>> >>>fs = 50 Hz >>> >>>passband ripple 0.01 dB >>> >>>stopband attenuation 144 dB >> >>You didn't say if this is streaming data or a chunk. >> >>Anyway, ignoring that "detail", in concept you might: >>Halfband filter and decimate by 2. >>Repeat this 12 times using the same filter each time. >> >>Look at it in the frequency domain: >>When you halfband filter, the samples from fs/4 to 3fs/4 go to nearly zero. >>In order to decimate in time, the spectra are "overlapped" or contracted at >>the center (fs/2) so those zeros go away. >>Then, you filter again..... >>The whole idea is to get to a spectrum that's 1/24th the original. >> >>Or, you might do it in one step: >>Multiply in frequency using the response of a "real" lowpass filter design >>to limit the frequency to something under 100Hz. >>Then delete the zeros from 100Hz to 4700Hz. That is, contract the spectrum >>from N to N/24 points. >>Then IFFT. >> >>If the time array is large to begin with, then this will be an efficient way >>of doing it - believe it or not.... >> >>Fred > > > Hi Fred, > > which is the advantage in using recursive half band filtering respect > to the "conventional" approach of low-pass filtering with fp=40Hz and > fs=50Hz and then decimating by a factor of 24? > perhaps the drawback of - first filtering and then decimating - is > that filter must work at a sample rate of 4800Hz. > > thanks. > Jack
While it is implementationally easy, I believe there are a couple of problems. 1) Since the same filter is reused it has some constraints on it based on the final transition width. In general the filters are longer than is really necessary - compare with multi-step decimation. 2) In the worst case the ripples in the passband will add together, this forces the filter to become longer since it must have reduced ripple. 3) The overall group delay of the filter is increased. I would suggest breaking the decimation down into steps - either 2 or 3 stages. The 144 dB attenuation is very high and you may run into problems with numerical stability in the filter design. I'm assuming you will be using PM/remez algorithm for the filter design. In the multi-stage design, you still have to watch out for point #2, but this can easily be accounted for in the filter design. The benefit of the multistage design is that the transition width of the first few stages can be really wide, you can also allow aliasing into the transition width (not the final one though) which allows the transition width to be even wider. Transition width is the main driver in the resulting filter length. The best book I've seen is: Multirate Digital Signal Processing - Crochiere and Rabiner Cheers, David
On Tue, 1 Mar 2005 16:53:22 +0100, "Elektro" <student@telia.se> wrote:

>How can I find the best way to decimate a input signal with a sampling >frequency of 4800 Hz down to 200 Hz with a desired response of: > > > >fp = 40 Hz > >fs = 50 Hz > >passband ripple 0.01 dB > >stopband attenuation 144 dB > > > >And I would be glad if i got some recommendation on some good books about >multi rate signal processing (a book with a lot of examples). >
Elektro, you received some very useful responses here. Even though you didn't say "Hello", "Thanks", or give your real name in your original post in which you strangers asked for help, you should (at least) post a "Thank You" to the talented guys here that took the time to help you. How would you like to be sitting in your office and suddenly in the doorway stands a stranger, ... and when you look up the stranger doean't say "Hello", but instead says, "How can I find the best way to ..."? [-Rick-] Officer of the "Decent Manners Police"
On 1 Mar 2005 16:31:04 -0800, "john" <johns@xetron.com> wrote:

> >Elektro wrote: >> How can I find the best way to decimate a input signal with a >sampling
(snipped)
> >I think a good approach for this D=24 problem is to divide into two FIR >stages. A simple explanation can be had in "Understanding DSP" by R. >Lyons, 2nd edition. A new book on multirate DSP by Harris is out now, >but that will take you much further afield than the problem you stated. > >John
Hi John, thanks for the "plug" for my book. I appreciate it. By the way, I think Harris' book is just terrific. John, I'll be happy to send you an errata for the 2nd edition of my book if you can tell me exactly what is the "Printing Number" of your copy of the book. You can find your "Printing Number" on the page just before the "Dedication" page. On that page (before the Dedication) you'll see all sorts of publisher-related information. Down toward the bottom of the page you should see lines that say: Printed in the United States of America First Printing However, it my have the words "Second Printing" or "Third Printing". Please let me know which "Printing Number" (in words) you have, and then I'll know which version of the errata I should send to you. [Remove the "_BOGUS_" from my address.] Thanks again, [-Rick-]