On Jul 9, 10:53*am, dbd <d...@ieee.org> wrote:
> On Jul 9, 12:11 am, Oli Charlesworth <ca...@olifilth.co.uk> wrote:.> dbd wrote:
>
> .>
> .> > The zero-stuffed H2 does not have the correct response for the
> single
> .> > stage filter design scheme given.
> .>
> .> Yes, but when convolved with H1, it does.
>
> No. The H1 from an efficiently designed two stage version does not
> have a narrow enough transition band to work with your H2' to form a
> single stage decimator with the same pass and stop bands.
I'm sorry, but yes it does work (try it!). The order of operations
can quite clearly be rearranged as I suggested in my previous post (as
did Verictor), with the result being mathematically equivalent. If
you disagree, then which of the following steps is incorrect? (i.e.
which transformation no longer results in a mathematically equivalent
system?)
1.) --> H1(z) --> v L1 --> H2(z) --> v L2 -->
2.) --> H1(z) --> H2(z^L1) --> v L1 --> v L2 -->
3.) --> H1(z) --> H2(z^L1) --> v L1.L2 -->
4.) --> H1(z).H2(z^L1) --> v L1.L2 -->
If you want to see it work in practice, here's some Matlab code:
% Random filters
h1 = randn(1, 10);
h2 = randn(1, 15);
% Decimation rates
L1 = 2;
L2 = 3;
% Random samples
x = randn(1,1000);
%%%%%%%%%%%%%%%%%%%
% Approach 1 - separate stages
%%%%%%%%%%%%%%%%%%%
% Filter by h1
t1 = filter(h1, 1, x);
% Decimate
t2 = t1(1:L1:end);
% Filter by h2
t3 = filter(h2, 1, t2);
% Decimate
y1 = t3(1:L2:end);
%%%%%%%%%%%%%%%%%%%
% Approach 2 - combine
%%%%%%%%%%%%%%%%%%%
% Combined filter
h = conv(h1, kron(h2, [1 zeros(1, L1-1)]));
% Filter samples by h
t4 = filter(h, 1, x);
% Combined decimate
y2 = t4(1

L1*L2):end);
%%%%%%%%%%%%%%%%%%%
% Compare
%%%%%%%%%%%%%%%%%%%
cla, hold on, plot(y1, 'b.-'), plot(y2, 'r.-')
--
Oli