Sign in

username or email:

password:



Not a member?
Forgot your password?

Search code



Search tips

Ads

See Also

Embedded SystemsFPGA

DSP Code Sharing > Subband coding speech signal-scilab code

Subband coding speech signal-scilab code

Language: Scilab

Processor: Not Relevant

Submitted by Senthilkumar R on Dec 28 2011

Licensed under a Creative Commons Attribution 3.0 Unported License

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



Comments


No comments yet for this code


Add a Comment
You need to login before you can post a comment (best way to prevent spam). ( Not a member? )