DSPRelated.com
Forums

Wavelet transformation of audio signals

Started by sanindland June 19, 2006
Hallo,

I am using .WAV files as audio signal input. For implementing D-4 Wavelet
filter coefficients of both HPF and LPF, its said that I have to multiply
with input array. How will you consider the input from WAV files as
arrays, also what will be in the case of stereo, where it has left and
right channel values? Also, I am in new in the world of wavelet. What is
the purpose of scaling function, if apply these filter coefficients to the
input array and doesn't bothers about the wrap around conditions?

Thanks in advance
San


sanindland wrote:
> Hallo, > > I am using .WAV files as audio signal input. For implementing D-4 Wavelet > filter coefficients of both HPF and LPF, its said that I have to multiply > with input array.
More accurately, you need to convolve the filters with the input.
> How will you consider the input from WAV files as > arrays, also what will be in the case of stereo, where it has left and > right channel values?
A digital audio signal like a .wav is just made up of a sequence of samples. In that way, it is just like any other digital signal you would supply as an input to a system. As for a stereo signal, you'll have two (presumably different) input signals on which you'll need to perform the same operations.
> Also, I am in new in the world of wavelet. What is > the purpose of scaling function, if apply these filter coefficients to the > input array and doesn't bothers about the wrap around conditions?
There are plenty of wavelet tutorials out there on the web and in books. Google them. But, to answer your question, the scaling function is used to capture the lowest scale you are considering. I'm not sure what you're getting at with the wrap-around question. Cheers! --M
Hallo, Thanks for your response. I doubt that I haven't understood your
reply exactly. Please confirm this.

>A digital audio signal like a .wav is just made up of a sequence of >samples. In that way, it is just like any other digital signal you >would supply as an input to a system. As for a stereo signal, you'll >have two (presumably different) input signals on which you'll need to >perform the same operations.
http://ccrma.stanford.edu/courses/422/projects/WaveFormat/ For example, the 2nd pic in the above link - how to consider the data from .wav files as s[i] D-4 scaling function: a[i] = h0*s[2i]+ h1*s[2i+1]+ h2*s[2i+2]+ h3*s[2i+3] where, s[i]-> input vector (I am using Visual basic environment. Any ideas/suggestions in general are also welcome)
>There are plenty of wavelet tutorials out there on the web and in >books. Google them. But, to answer your question, the scaling function >is used to capture the lowest scale you are considering. I'm not sure >what you're getting at with the wrap-around question.
I do have only a vague idea about wrap-around conditions. Reference: in page no.592, 5th line below the matrix(13.10.1) in the following link http://www.library.cornell.edu/nr/bookcpdf/c13-10.pdf Thanks in advance, San
sanindland wrote:
> Hallo, Thanks for your response. I doubt that I haven't understood your > reply exactly. Please confirm this. > > >A digital audio signal like a .wav is just made up of a sequence of > >samples. In that way, it is just like any other digital signal you > >would supply as an input to a system. As for a stereo signal, you'll > >have two (presumably different) input signals on which you'll need to > >perform the same operations. > > http://ccrma.stanford.edu/courses/422/projects/WaveFormat/ > > For example, the 2nd pic in the above link - how to consider the data from > .wav files as s[i]
The 16-bit words labeled "samples" are the data to filter. The odd samples (starting counting at 1 as in Basic, rather than 0 as in C) are from the left channel and the even from the right. The other stuff is information about the signal that you may find useful, e.g., the length of the signal, the samples per second, etc.
> D-4 scaling function: > a[i] = h0*s[2i]+ h1*s[2i+1]+ h2*s[2i+2]+ h3*s[2i+3] > where, s[i]-> input vector
Assuming this line is in a loop, it's fine, ignoring edge effects. See the function as it is implemented on pp. 595f of the reference you cite below.
> (I am using Visual basic environment. Any ideas/suggestions in general are > also welcome) > > >There are plenty of wavelet tutorials out there on the web and in > >books. Google them. But, to answer your question, the scaling function > >is used to capture the lowest scale you are considering. I'm not sure > >what you're getting at with the wrap-around question. > > I do have only a vague idea about wrap-around conditions. > Reference: in page no.592, 5th line below the matrix(13.10.1) in the > following link > > http://www.library.cornell.edu/nr/bookcpdf/c13-10.pdf
In their code, they use wrap around: wksp[i]=C0*a[n-1]+C1*a[n]+C2*a[1]+C3*a[2]; Some applications might be better with mirroring instead: wksp[i]=C0*a[n-1]+C1*a[n]+C2*a[n]+C3*a[n-1]; or even zeros: wksp[i]=C0*a[n-1]+C1*a[n]; It just depends on your needs. Cheers! --M
Hi there, Thanks a lot of your reply - San