[chuck-users] Using Wavelet Transform

Julien Saint-Martin julien.saintmartin at googlemail.com
Tue May 14 05:56:41 EDT 2013


Hi Fernando,

I cannot try it right now but I think you can use this function:

adc.last() to get each unitary sample.
last() is normally available for all UGen so I think it is ok for adc.

Use a loop to fill your input[] array and when filled call your
discreteHaarWaveletTransform function.

Have fun,
Ju


2013/5/13 fernando alonso <lualobus at gmail.com>

> Hi guys,
>
> I have implemented the Wavelet Transform in Chuck (to work with it
> moreover of FFT, etc). The code is:
>
> fun int[] discreteHaarWaveletTransform( int input[]){
>
>     int sum, difference,length,i;
>
>     int  output[input.cap()];
>
>      for ( (input.cap() >> 1) => length ; true ;  (length >> 1) => length) {
>
>         for (0 => i; i < length; ++i) {
>
>             input[i * 2] + input[i * 2 + 1] => sum;
>
>             input[i * 2] - input[i * 2 + 1] => difference;
>
>             sum => output[i] ;
>
>             difference => output[length + i];
>
>         }
>
>         if (length == 1) {
>
>             return output;
>
>         }
>
>          //Swap arrays to do next iteration
>
>         for (0=>i; i < (length<<1); i++){
>
>             output[i] => input[i];
>
>         }
>
>     }
>
> }
>
>
>
>
> The only one problem is that I don't know how get from adc the values of
> the microphone input signal. I don't want to use FFT or similar. My
> implementation of Haar Wavelet Transform need this values.
>
>
> Anybody knows how get its?
>
> Thanks so much.
>
>
> --
> Fernando Alonso Martín
> Lualobus at gmail.com
> http://roboticnaturalinteraction.com<http://www.roboticNaturalInteraction.com/famartin.html>
>
>
> _______________________________________________
> chuck-users mailing list
> chuck-users at lists.cs.princeton.edu
> https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20130514/9d31a3d4/attachment.html>


More information about the chuck-users mailing list