jim wrote: ...> [1 2 1] > [1 2 1]/4Erm...? Not [1 0 2 0 1] [1 0 2 0 1]/4 ? ... Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
Half-Band Filter Length
Started by ●November 17, 2004
Reply by ●November 19, 20042004-11-19
Reply by ●November 19, 20042004-11-19
Jerry Avins wrote:> > jim wrote: > > ... > > > [1 2 1] > > [1 2 1]/4 > > Erm...? Not > [1 0 2 0 1] > [1 0 2 0 1]/4 ? >That has a length of 5. The length is 4*n-1 of the form: ...X 0 X 0 X C X 0 X 0 X... -jim ----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==---- http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups ---= East/West-Coast Server Farms - Total Privacy via Encryption =---
Reply by ●November 19, 20042004-11-19
jim wrote:> > Jerry Avins wrote: > >>jim wrote: >> >> ... >> >> >>>[1 2 1] >>>[1 2 1]/4 >> >>Erm...? Not >>[1 0 2 0 1] >>[1 0 2 0 1]/4 ? >> > > > That has a length of 5. The length is 4*n-1 of the form: > > ...X 0 X 0 X C X 0 X 0 X... > > -jimOuch! Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
Reply by ●November 19, 20042004-11-19
"jim" <"N0sp"@m.sjedging@mwt.net> wrote in message news:419df322$1_1@127.0.0.1...>.....>Yes, your saying the same as Juha. But consider these 2 filters.>[1 2 1] >[1 2 1]/4> By your definition the second is a half-band filter and the first is > not. Now someone might point out that the only difference in the output > of the 2 filters is a gain of 4. Personally, I tend to find it more > often useful to view the DC gain as separated from the frequency > response. But, your definition is valid and its not to difficult to > construct scenario's where it would produce a more useful filter. > > -jimJim, I wasn't trying to create a "definition" re: scaling. Thus my cryptic remark "Same scaling property....." which was meant to address that matter. So, either one of your examples above is a half-band filter. Fred
Reply by ●November 19, 20042004-11-19
"Juha" <foo@bar.org> wrote in message news:cnhvo7$2osq$1@news.cc.tut.fi...> It is not exactly true that the middle coefficient will be equal to the > sum of the other coefficients. The sum of the coefficients is equal to > magnitude response at the zero frequency and for the half-band filters the > magnitude response at zero frequency is either 1-delta or 1+delta where > delta is the ripple in the pass- and stopband. > > Of course, the filter can be scaled some other way but in this case the > correspondin lowpass-highpass filter pair can be implemented as a parallel > connection of G(z^2) and 1/2z^{-M}, where M is the half the filter order > and the zero-phase response H(omega) satisfies H(omega)+H(pi-omega)=1. > > % Matlab code > M = 21; % must be odd > passbandEdge = 0.4; h = []; > h((M+1):M:(2*M+1)) = [0.5 0]; > [g, ripple] = remez(M, [0 2*passbandEdge 1 1], ... > [0.5 0.5 0 0], {128}) > > h(1:2:end) = g(1:end); > [H, w] = freqz(h, 1, 2^10, 2); > iPassband = find(w <= passbandEdge); > plot(w(iPassband), abs(H(iPassband))) > > disp(['ripple = ' num2str(ripple) ' = ' num2str(abs(1-abs(H(1)))) ... > ' = ' num2str(abs(1-sum(h)))]) > > -- > JuhaJuha, Right about F(0) but could you help me envision better what the comment "the correspondin lowpass-highpass filter pair" is about? That's not a construct I'm familiar with. Fred
Reply by ●November 19, 20042004-11-19
Fred Marshall wrote:> > > Right about F(0) but could you help me envision better what the comment "the > correspondin lowpass-highpass filter pair" is about? That's not a construct > I'm familiar with.I think Juha already provided an explanation. But here's a simpler way of looking at it. If you take your cosine coefficients and invert the signs then when you add the constant you now have a high pass filter. The other half of the band if you wish. The sum of the 2 will be the constant middle term. -jim ----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==---- http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups ---= East/West-Coast Server Farms - Total Privacy via Encryption =---
Reply by ●November 19, 20042004-11-19
"jim" <"N0sp"@m.sjedging@mwt.net> wrote in message news:419e5892$1_1@127.0.0.1...> > > Fred Marshall wrote: >> >> >> Right about F(0) but could you help me envision better what the comment >> "the >> correspondin lowpass-highpass filter pair" is about? That's not a >> construct >> I'm familiar with. > > I think Juha already provided an explanation. But here's a simpler way > of looking at it. If you take your cosine coefficients and invert the > signs then when you add the constant you now have a high pass filter. > The other half of the band if you wish. The sum of the 2 will be the > constant middle term. > > -jimHmmmmm.... I'm doubtful about the math....: Granted, if you take the cosine coefficients and invert the signs then you will have an inverted version of the cosine part of the filter response. Obviously, each have zero average because it's made up of entire integral cycles of cosines. The sums of the cosines mirror about fs/2. Now, if you add the same *proper* constant each of them you will get a lowpass filter and a highpass filter which continue to mirror around fs/2. The value of the constant to be added has to be such that F'(0)+delta = F'(fs/2)-delta. So, if we're starting with the passband objective criterion of 1.00 and have the constant=0 and have the sum of cosines F(0)=.6, we know that F(fs/2)=-0.6 due to the antisymmetry. So the constant has to be 0.5 times the passband objective criterion. Here that is 0.5 so that F'(0)=1.1 and F'(fs/2)=-0.1. This is the same thing as designing a lowpass filter from zero to fs/4 using only odd cosines with a passband objective criterion of 0.5 and then adding a constant value of 0.5 to the result. The sum of the two filter responses will yield 2x the constant that was added to each and not 1x the constant. Anyway, I don't see how you can derive the constant from any of this as seems to be implied. Surely if you know the cosine coefficients, you will also know the constant value. Fred
Reply by ●November 19, 20042004-11-19
Fred Marshall wrote:> > Granted, if you take the cosine coefficients and invert the signs then you > will have an inverted version of the cosine part of the filter response. > Obviously, each have zero average because it's made up of entire integral > cycles of cosines. The sums of the cosines mirror about fs/2. > > Now, if you add the same *proper* constant each of them you will get a > lowpass filter and a highpass filter which continue to mirror around fs/2. > The value of the constant to be added has to be such that F'(0)+delta = > F'(fs/2)-delta. > So, if we're starting with the passband objective criterion of 1.00 and have > the constant=0 and have the sum of cosines F(0)=.6, we know that > F(fs/2)=-0.6 due to the antisymmetry. >Ok, a length 3 filter would be: [.3 .5 .3] A length 7 might look something like: [-.15 0 .315 .5 .315 0 -.15] The high pass versions would be [-.3 .5 -.3] and [.15 0 -.315 .5 -.315 0 .15]> So the constant has to be 0.5 times the passband objective criterion. Here > that is 0.5 so that F'(0)=1.1 and F'(fs/2)=-0.1.By my reckoning for your filter F(0)=1.1 and F(fs/2)=-0.1. After flipping the signs F'(0)=-0.1 and F'(fs/2)=1.1> This is the same thing as designing a lowpass filter from zero to fs/4 using > only odd cosines with a passband objective criterion of 0.5 and then adding > a constant value of 0.5 to the result. > > The sum of the two filter responses will yield 2x the constant that was > added to each and not 1x the constant.Yes, your right, my mistake. Its 2x the constant. For your filter the sum of the 2 filters is 2*0.5=1 The low pass and high pass each contain half the freqiency domain hence the name. -jim> Anyway, I don't see how you can > derive the constant from any of this as seems to be implied. Surely if you > know the cosine coefficients, you will also know the constant value.----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==---- http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups ---= East/West-Coast Server Farms - Total Privacy via Encryption =---
Reply by ●November 20, 20042004-11-20
Juha, Thanks for your response. You bring an interesting view which I'm not sure I follow. Allow me to ask some questions below. Juha <foo@bar.org> writes:> jim wrote: >> Randy Yates wrote: >> >>>Hi comp.dsp, >>> >>>Rick Lyons [lyonsnew] states that if S is the number >>>of taps in a half-band filter, then S+1 must be divisible >>>by four. >> Hi Randy, >> Well, assuming "the number of taps" has a unique meaning (which it >> doesn't if we can merely append zeroes at the beginning or end), the >> reason is symmetry. In order for the magnitude response to be symmetric >> (or anti-symmetric) the filter length must be 4n-1 (n = some integer) >> and the middle coefficient will be equal to the sum of the other >> coefficients. Of course one needs to define a half-band filter as being >> symmetrical in the frequency domain for this to apply. >> -jim >> ----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet >> News==---- >> http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups >> ---= East/West-Coast Server Farms - Total Privacy via Encryption =--- > > It is not exactly true that the middle coefficient will be equal to > the sum of the other coefficients. The sum of the coefficients is > equal to magnitude response at the zero frequency and for the > half-band filters the magnitude response at zero frequency is either > 1-delta or 1+delta where delta is the ripple in the pass- and stopband.Why? Why is the response at DC necessarily one of these two values? Why couldn't it be the case that 1-delta < H(0) < 1+delta?> Of course, the filter can be scaled some other way but in this case > the correspondin lowpass-highpass filter pairWhat do you mean? Are you saying that for any valid filter order M there is associated a pair of half-band filters, one lowpass and one highpass?> can be implemented as a > parallel connection of G(z^2)...an upsampler by two..> and 1/2z^{-M}, where M is the half the > filter order and the zero-phase response H(omega) satisfies > H(omega)+H(pi-omega)=1.I don't see at all where this comes from. Could you please expound? -- % Randy Yates % "Rollin' and riding and slippin' and %% Fuquay-Varina, NC % sliding, it's magic." %%% 919-577-9882 % %%%% <yates@ieee.org> % 'Living' Thing', *A New World Record*, ELO http://home.earthlink.net/~yatescr
Reply by ●November 20, 20042004-11-20






