crossover matlab,Speaker Crossover Filters

Speaker Crossover Filters

This example shows how to devise a simple model of a digital three-way loudspeaker. The system splits the audio input into low-, mid-, and high-frequency bands that correspond respectively to the woofer, the midrange driver, and the tweeter. Typical values for the normalized crossover frequencies that delimit the bands are 0.136π rad/sample and 0.317π rad/sample.

Create lowpass, bandpass, and highpass filters to generate the low-frequency, mid-frequency, and high-frequency bands. Specify the frequencies.

lo = 0.136;

hi = 0.317;

Use a 6th-order Chebyshev Type I design for each filter. Specify a passband ripple of 1 dB, larger than the value for real speakers. The cheby1 function doubles the order of bandpass designs. Make all filters have the same order by halving the order of the bandpass filter. Return the zeros, poles, and gain of each filter.

ord = 6;

rip = 1;

[zw,pw,kw] = cheby1(ord,rip,lo);

[zm,pm,km] = cheby1(ord/2,rip,[lo hi]);

[zt,pt,kt] = cheby1(ord,rip,hi,'high');

Visualize the zeros and poles of the filters.

zplane([zw zm zt],[pw pm pt])

lg = legend('Woofer','Midrange','Tweeter');

lg.Box = 'off';

dadcc2a5270d145172ace0121b576ad2.png

Woofer: The zeros at z=-1 suppress high frequencies. The poles enhance the magnitude response between 0 and the lower crossover frequency.

Midrange: The zeros at z=0 and z=1 suppress high and low frequencies. The poles enhance the magnitude response between the lower and higher crossover frequencies.

Tweeter: The zeros at z=1 suppress low frequencies. The poles enhance the magnitude response between the higher crossover frequency and π.

Plot the magnitude responses on the unit circle to see the effect of the different poles and zeros. Use linear units. Represent the filters as second-order sections.

sw = zp2sos(zw,pw,kw);

sm = zp2sos(zm,pm,km);

st = zp2sos(zt,pt,kt);

nf = 1024;

[hw,fw] = freqz(sw,nf,'whole');

hm = freqz(sm,nf,'whole');

ht = freqz(st,nf,'whole');

plot3(cos(fw),sin(fw),[abs(hw) abs(hm) abs(ht)])

xlabel('Real')

ylabel('Imaginary')

view(75,30)

grid

ba700a7fe88731af8ced16750ee5acfc.png

Plot the magnitude responses in dB using fvtool.

hfvt = fvtool(sw,sm,st);

legend(hfvt,'Woofer','Mid-range','Tweeter')

062ae89c11c1c14f0030c45227e9ce02.png

Load an audio file containing a fragment of Handel's "Hallelujah Chorus" sampled at 8192 Hz. Split the signal into three frequency bands by filtering. Plot the bands.

load handel % To hear, type soundsc(y,Fs)

yw = sosfilt(sw,y); % To hear, type soundsc(yw,Fs)

ym = sosfilt(sm,y); % To hear, type soundsc(ym,Fs)

yt = sosfilt(st,y); % To hear, type soundsc(yt,Fs)

plot((0:length(y)-1)/Fs,[yw ym yt])

xlabel('Time (s)')

7830bef785be420848361868fa8f47aa.png

% To hear all the frequency ranges, type soundsc(yw+ym+yt,Fs)

References

Orfanidis, Sophocles J. Introduction to Signal Processing. Englewood Cliffs, NJ: Prentice Hall, 1996.

See Also

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值