Subband coding speech signal-scilab code
This program is used for subband coding of speech signals and plotting their response
//Caption: write a program for subband coding of speech signal
clear;
clc;
[x
,Fs
,bits
]=wavread("E:\4.wav");
n
= length(x
)
//Low Pass Filter of Length = 19, Wc = 0.5, Hamming Window
[wft_LPF
,wfm_LPF
,fr_LPF
]=wfir('lp',18,[0.25,0],'hm',[0,0])
//High Pass Filter of Length = 19, Wc = 0.5, Hamming Window
[wft_HPF
,wfm_HPF
,fr_HPF
]=wfir('hp',18,[0.25,0],'hm',[0,0])
//LPF output
Y_lpf
= convol(x
,wft_LPF
)
//HPF output
Y_hpf
= convol(x
,wft_HPF
)
//Downsampling by a factor of 2
Downsampling_XLPF
= Y_lpf
(1:2:length(Y_lpf
));
Downsampling_XHPF
= Y_hpf
(1:2:length(Y_hpf
));
figure(1)
subplot(3,1,1)
plot([1:n
],x
)
xtitle("ORIGINAL Speech SIGNAL");
subplot(3,1,2)
plot([1:length(Y_lpf
)],Y_lpf
)
xtitle("Low Pass Filtered Speech SIGNAL");
subplot(3,1,3)
plot([1:length(Y_hpf
)],Y_hpf
)
xtitle("High Pass Filtered Speech SIGNAL");
figure(2)
subplot(2,1,1)
plot([1:length(Y_lpf
)],Y_lpf
)
xtitle("Low Pass Filtered Speech SIGNAL");
subplot(2,1,2)
plot([1:length(Downsampling_XLPF
)],Downsampling_XLPF
,'r')
xtitle("LPF Output Downsampled by 2");
figure(3)
subplot(2,1,1)
plot([1:length(Y_hpf
)],Y_hpf
)
xtitle("High Pass Filtered Speech SIGNAL");
subplot(2,1,2)
plot([1:length(Downsampling_XHPF
)],Downsampling_XHPF
,'r')
xtitle("HPF Output Downsampled by 2");
Rate this code snippet:
0
Rating: 0 | Votes: 0
posted by Senthilkumar R