Jump to content

Guys can anyone over help me with this code..
we are doing a small project on speech filter just as a practical...
and we where using this matlab code(.m file) and where getting both non filtered and filtered waveforms, but later on we got to know that we need to perform this on scilab and thus using this function mfile2sci(); we converted our matlab code to scilab(.sci file), but when code to scilab we cant get the output for our filtered wave form. can anyone over have a look at this to codes. i have added both the matlab and scilab code in following order:
1. matlab code

2. scilab code

.m file%filtering of speech signal using FIR-LPF clear all;fp=fopen('C:\Users\Ashish\Desktop\Main\watermark.wav','r');fseek(fp,44,-1);a=fread(fp,1024);plot(a);title('plot of speech signal');xlabel('sample number');ylabel('Amplitude');fs=16000;t=0.00125;Q=fs/2*t;disp(Q);for i=1:10, x(i)=(sin(0.125*pi*i))/(i*pi);enda(11)=0.125;for i=1:10, a(i)=x(Q-(i-1));endfor i=2:11,a(i+Q)=x(i-1);endw1=window(@blackman,21);for i=1:21, z(i)=a(i)*w1(i);endc=conv(a,z);figure;plot(c);axis([1 1024 80 130]);title('plot of filtered speech signal');xlabel('sample number'); ylabel('Amplitude');
.sci file// Display modemode(0);// Display warning for floating point exceptionieee(1);//filtering of speech signal using FIR-LPFclear;fp = mtlb_fopen("E:\4.wav","r");mseek(44,fp,"set");// L.5: No simple equivalent, so mtlb_fread() is called.a = mtlb_fread(fp,1024);plot(a);title("plot of speech signal");xlabel("sample number");ylabel("Amplitude");fs = 16000;t = 0.00125;Q = (fs/2)*t;disp(Q);for i = 1:10  x(1,i) = sin((0.125*%pi)*i)/(i*%pi);end;a(1,11) = 0.125;for i = 1:10  a(i) = x(Q-(i-1));end;for i = 2:11  a = mtlb_i(a,i+Q,x(i-1));end;// !! L.22: Matlab toolbox(es) function window not converted, original calling sequence usedw1 = window("blackman",21);for i = 1:21  z(1,i) = matrix(a(i)*mtlb_double(mtlb_e(w1,i)),1,-1);end;c = conv(a,z);// !! L.27: Matlab function figure not yet converted.// !! L.27: Matlab function figure not yet converted, original calling sequence used.// L.27: (Warning name conflict: function name changed from figure to %figure).figure();plot(c);set(gca(),"data_bounds",matrix([1,1024,80,130],2,-1));title("plot of filtered speech signal");xlabel("sample number");ylabel("Amplitude");

Thank you. :)

[CPU: AMD FX(tm)-4350 @4.2GHz ] [MoBo: 970 PRO GAMING/AURA] [Ram: 2x8GB HyperX FURY 8GB 1600MHz DDR3] [GPU: NVIDIA GeForce GTX 1060 6GB] [PSU: Corsair VS550Watt] [HDD: 2TB Seagate Barracuda + 1TB WD green] [CPU Cooler: JONSBO CPU AIR COOLER - CR-201 RED LED] [Display: LG 24MP88HV-S 24-inch Slim IPS] -Did i solve your question/problem? Please click 'Marked Solved'-

Link to comment
https://linustechtips.com/topic/459179-need-help/
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×