[CM] hilbert transformer and other FIR filter stuff

cristopher pierson ewing cewing@u.washington.edu
Tue, 7 Jan 2003 09:18:13 -0800 (PST)


Actually, Bill.  I' was just about to write you to point that out.  I'll
try the new code today.  I've also created a structure and macro to run
it that are derived from Sean Costello's Hilbert opcode in Csound. As soon
as I am finished testing it, Ill send it along to you for your perusal.

Thanks for all,

C

********************************
Cris Ewing
CARTAH Assistant
University of Washington
Home Phone: (206) 365-3413
E-mail: cewing@u.washington.edu
*******************************


On Tue, 7 Jan 2003, Bill Schottstaedt wrote:

> Speaking of the CLM Hilbert transformer -- the code looks
> broken to me -- I think a crucial line got lost at some
> point.  Just for lafs I conjured up this Scheme version:
>
> (define* (make-hilbert-transform #:optional (len 30))
>   (let* ((arrlen (1+ (* 2 len)))
> 	 (arr (make-vct arrlen)))
>     (do ((i (- len) (1+ i)))
> 	((= i len))
>       (let* ((k (+ i len))
> 	     (denom (* pi i))
> 	     (num (- 1.0 (cos (* pi i)))))
> 	(if (= i 0)
> 	    (vct-set! arr k 0.0)
> 	    (vct-set! arr k (/ num denom)))))
>     (make-fir-filter arrlen arr)))
>
> (define (hilbert-transform f in)
>   (fir-filter f in))
>
> #!
>   (let ((h (make-hilbert-transform 15)))
>     (map-channel (lambda (y)
> 		   (* 8.0 (hilbert-transform h y)))))
> !#
>
> I'll replace the CLM version with a translation
> of this code.  As long as I was typing in FIR filter
> code, I figured I might as well add lowpass, highpass,
> bandstop, bandpass, and differentiators of any order --
> see dsp.scm.
> _______________________________________________
> Cmdist mailing list
> Cmdist@ccrma.stanford.edu
> http://ccrma-mail.stanford.edu/mailman/listinfo/cmdist
>