Octave crossover script

From DRC

Jump to: navigation, search
# Robert Scheer 10/6/2004
# Chris Birkinshaw 06/05/05
# GTS October 2005

# Beginning of user parameters

n=11; # exponent for filter size
fxo_low=550; # ir_low crossover frequency in Hz
fs=44100; # sample rate in Hz

# End of user parameters


k=2^n; # order of filter
fn_low=2*fxo_low/fs; # normalized ir_lowsonic cutoff frequency 

i=linspace(1,k,k); # k_tap filter array

ir_hi=fir1(k,fn_low,'high','scale'); # high_pass impulse response
ir_low=fir1(k,fn_low,'low','scale'); # low_pass ir

ir_hitxt=ir_hi(i); # my klugey way of taking k elements
ir_lowtxt=ir_low(i);

save -ascii ./high_oct.txt ir_hitxt
save -ascii ./low_oct.txt ir_lowtxt