DSPRelated.com
Forums

The coefficients of the analysis filter

Started by mariya September 4, 2005
mariya wrote:

> In the matlab software(version 7.0) that i am using , it showns > that the impulse reponses of the decomposition and reconstruction > filters are different.
Oh well, sorry for that. My previous statement should of course have read: The analysis and synthesis *matrices* are the same *up to transposition* for ortho*normal* transforms. But wait a second, the impulse responses are precisely the coefficients -- so you want the analytic relationship, right? Look at equations 1 and 2 in http://www.library.cornell.edu/nr/bookcpdf/c13-10.pdf while reading what follows. Define: N -- filter length, L -- transform length, c[n], n = 0..N-1 -- wavelet or scaling filter coefficients, c[n] = 0 otherwise, d[n], n = 0..N-1 -- same filter for inverse transform, A[k, n] -- L x L transform matrix. Take all subscripts to be modulo L. We find by inspection: A[0, n] = c[n], A[1, n] = (-1)^n c[N-n-1], A[k, n] = A[k-2, n-2], d[n] = A[L-N+2 + n, 0]. Unravel the last two lines to find d in terms of c. This is easiest done separately for even and odd n; in the latter case you will need to remember that L and N are both even. If you get stuck, put down the top left corner of A with just the indices, like this -- 0 1 [2] 3 3 2 [1] 0 [0] 1 [3] 2 -- also for N = 6 and 8 to try and spot what the result *should* be. Show your algebra if that won't help. Martin -- Quidquid latine dictum sit, altum viditur.
>mariya wrote: > >> In the matlab software(version 7.0) that i am using , it showns >> that the impulse reponses of the decomposition and reconstruction >> filters are different. > >Oh well, sorry for that. My previous statement should of course have >read: The analysis and synthesis *matrices* are the same *up to >transposition* for ortho*normal* transforms. But wait a second, the >impulse responses are precisely the coefficients --
________________________________________________________________ Excatly the impulse response are the coefficients of the filters ! here is what i read from my matlab version about how to get the reconstruction filter's coefficients maybe it can explain well what i am looking for! "Consider the low-pass reconstruction filter (L') for the db2 wavelet". The filter coefficients can be obtained from the dbaux command: Lprime = dbaux(2) Lprime = 0.3415 0.5915 0.1585 -0.0915 If we reverse the order of this vector (see wrev), and then multiply every even sample by -1, we obtain the high-pass filter H': Hprime = -0.0915 -0.1585 0.5915 -0.3415 Then, what i have been trying to figure out how to get the coefficients of the analysis filters? I believe there is way out but how..... This message was sent using the Comp.DSP web interface on www.DSPRelated.com
mariya wrote:

>>The analysis and synthesis *matrices* are the same >>*up to transposition* for ortho*normal* transforms. But wait a >>second, the impulse responses are precisely the coefficients -- > > ________________________________________________________________ > > Excatly the impulse response are the coefficients of the filters > ! here is what i read from my matlab version about how to get > the reconstruction filter's coefficients maybe it can explain > well what i am looking for!
[snip]
> Then, what i have been trying to figure out how to get the > coefficients of the analysis filters? I believe there is way out > but how.....
Have you read the rest of what I wrote? -- Quidquid latine dictum sit, altum viditur.
sure i did read what you wrote but the point was it was beyond my current
knowledge about wavelet transform ! if there is not any other easy way how
i can get these coeff. i really do appreciate the time you took to answer
to this posts!Maybe i should move on and try to design ideal lowpass and
highpass filters for the wavelet transform!
> >Have you read the rest of what I wrote? > >-- >Quidquid latine dictum sit, altum viditur. >
This message was sent using the Comp.DSP web interface on www.DSPRelated.com
mariya wrote:

> sure i did read what you wrote but the point was it was beyond > my current knowledge about wavelet transform ! if there is not > any other easy way how i can get these coeff.
I don't anticipate an easier way because what I suggested has not much to do with wavelets as such. It's mostly pushing letters around, and it's definitely not over the head of someone who dares ponder wavelets in the first place ;) However, I have a tendency to be rather terse -- if that was the problem you'd better have pointed out just where it happened instead of letting everything disappear. On Usenet, nobody knows your eyes are glazing over... So let's try again to find the analysis scaling filter. Call that filter's coefficients d[n]; call the synthesis scaling coefficients c[n] for simple comparison with eq. 1 and 2 in http://www.library.cornell.edu/nr/bookcpdf/c13-10.pdf . Either filter is of length N, an even number. The square matrix in eq. 1 has size L, also even. Call the matrix A. Further set c[n] = 0, n = N..L-1 so that c is the first row vector of A. Still with me, Mariya? Purely for notational convenience, take all subscripts to be modulo L, e.g. c[n + kL] = c[n] for any integer k. I've already said two sentences earlier that A[0, n] = c[n]. You implied you know that the synthesis wavelet coefficients are described by the second row of A: A[1, n] = (-1)^n c[N-n-1]. The matrix is structured according to A[k, n] = A[k-2, n-2], as eq. 1 shows. Observe the wraparound in the last few rows, corresponding to my mod-L convention. In looking at the example, note well that more than two rows exhibit wraparound for N > 4; specifically, their number is N-2 -- right? Now, the analysis filter is present in the first row of A^(-1) = A^T in eq. 2, but not starting at the leftmost position. Rather the offset from the right is equal to the number of wrapping bottom rows of A. Thus we find that d[n] = A^T[0, L-N+2 + n] = A[L-N+2 + n, 0], n = 0..N-1. We're almost there! Suppose that n is even and, using the structure of A, rewrite the last expression to involve the first row of A: d[n] = A[L-N+2+n, 0] = A[L-N+2+n - 2, -2] = ... = A[0, -(L-N+2+n)] = A[0, N-n-2] (mod L, remember) = c[N-n-2]. I trust you can do the case d[n+1] = A[1, x] = c[x] yourself. Finally, note that the relation between wavelet and scaling filters is the same for both the forward and inverse transform (or adapt the preceding description to start out with A^T[1, L-N+2 + n]) to wrap up our work. Martin -- Teach a man to make fire, and he will be warm for a day. Set a man on fire, and he will be warm for the rest of his life. --John A. Hrastar
>Still with me, Mariya?
Honestly, I am totally lost! I wish i could understand your explanations. This may seem weird to you,but my current knowledge about the discrete wavelet transform has just been the subband coding where we are dealing with digital filters. my next step would be just to design some other filters as long as i cannot understand the algorithm you described! Thanks for your patience and your time! This message was sent using the Comp.DSP web interface on www.DSPRelated.com
mariya wrote:

>>Still with me, Mariya? > > Honestly, I am totally lost!
Hm. Well, maybe just put the last message somewhere you'll stumble over it in six months' time. Until then, here's the final result: To go from either synthesis filter to the corresponding analysis filter (or vice versa), reverse the subsequence of even-numbered coefficients and interleave it back with the unchanged odd-numbered coefficients. Example: [c0 c1 c2 c3 c4 c5] -> [c4 c1 c2 c3 c0 c5]. Martin -- Quidquid latine dictum sit, altum viditur.