diff options
Diffstat (limited to 'src/Scilab2C/SCI2CTests/Mes_tests/signalProcessing')
5 files changed, 177 insertions, 0 deletions
diff --git a/src/Scilab2C/SCI2CTests/Mes_tests/signalProcessing/mainfunctionConvol.sci b/src/Scilab2C/SCI2CTests/Mes_tests/signalProcessing/mainfunctionConvol.sci new file mode 100644 index 0000000..41c3860 --- /dev/null +++ b/src/Scilab2C/SCI2CTests/Mes_tests/signalProcessing/mainfunctionConvol.sci @@ -0,0 +1,47 @@ +//SCI2C: DEFAULT_PRECISION= DOUBLE + +function mainfunction()
+ +//test convol + +disp (convol(3,5)) +disp (convol(3+2*%i,5-%i)) + +disp (convol(3,5+3*%i)) +disp (convol(3+2*%i,2)) + +c=[1 2 3] +d=[4 5 6 7 8] +e=[2+3*%i 4+4*%i 7-5*%i 8+%i] +f=[1+5*%i 3-2*%i 1-%i] + +disp (convol(3,d)) +disp (convol(3,f)) +disp (convol(c,2)) +disp (convol(e,5)) + +disp (convol(3-%i,d)) +disp (convol(3+2*%i,f)) +disp (convol(c,2+2*%i)) +disp (convol(e,5+%i)) + +disp (convol(c,d)) +disp (convol(c,f)) +disp (convol(e,c)) +disp (convol(e,f)) + +//the following lines don't exist in Scilab but are in Sci2C + +//g=[1 2; 3 4] +//h=[4 5; 6 7] +//i=[2+3*%i 4+4*%i; 7-5*%i 8+%i] +//j=[1+5*%i 4+4*%i; 3-2*%i 1-%i] + +//disp (convol(g,h)) +//disp (convol(g,j)) +//disp (convol(i,h)) +//disp (convol(i,j)) + + + +endfunction diff --git a/src/Scilab2C/SCI2CTests/Mes_tests/signalProcessing/mainfunctionFft.sci b/src/Scilab2C/SCI2CTests/Mes_tests/signalProcessing/mainfunctionFft.sci new file mode 100644 index 0000000..e9d11ac --- /dev/null +++ b/src/Scilab2C/SCI2CTests/Mes_tests/signalProcessing/mainfunctionFft.sci @@ -0,0 +1,38 @@ +//SCI2C: DEFAULT_PRECISION= DOUBLE
+ +function mainfunction()
+ + +// test fftshift + +//1 input argument +disp(fft(4)) + +disp(fft([3 4 2 1; 1 4 5 2])); + +disp(fft(4-%i)) + + +disp(fft([3+%i*2 4 2-%i 1; 1-%i*2 4 5 2])); + +//2 input arguments + +disp(fft(4,1)) + +disp(fft([3 4 2 1; 1 4 5 2],1)); + +disp(fft(4-%i,1)) + + +disp(fft([3+%i*2 4 2-%i 1; 1-%i*2 4 5 2],1)); + +disp(fft(4,-1)) + +disp(fft([3 4 2 1; 1 4 5 2],-1)); + +disp(fft(4-%i,-1)) + + +disp(fft([3+%i*2 4 2-%i 1; 1-%i*2 4 5 2],-1)); + +endfunction diff --git a/src/Scilab2C/SCI2CTests/Mes_tests/signalProcessing/mainfunctionFftShift.sci b/src/Scilab2C/SCI2CTests/Mes_tests/signalProcessing/mainfunctionFftShift.sci new file mode 100644 index 0000000..b562894 --- /dev/null +++ b/src/Scilab2C/SCI2CTests/Mes_tests/signalProcessing/mainfunctionFftShift.sci @@ -0,0 +1,30 @@ +//SCI2C: DEFAULT_PRECISION= DOUBLE
+ +function mainfunction()
+ + +// test fftshift + +disp(fftshift(4)) +disp(fftshift(5,1)) +disp(fftshift(6,2)) + +disp(fftshift(4-%i)) +disp(fftshift(4-%i*2,1)) +disp(fftshift(4-%i*3,2)) + +a=[2 3 4 8; 8 4 5 6;1 2 3 4; 14 5 8 7; 1 2 6 7] +b=[2 3 4 8;1 2 6+3*%i 7] + + +disp(fftshift(a)) +disp(fftshift(a,1)) +disp(fftshift(a,2)) + + +disp(fftshift(b)) +disp(fftshift(b,1)) +disp(fftshift(b,2)) + + +endfunction diff --git a/src/Scilab2C/SCI2CTests/Mes_tests/signalProcessing/mainfunctionIfft.sci b/src/Scilab2C/SCI2CTests/Mes_tests/signalProcessing/mainfunctionIfft.sci new file mode 100644 index 0000000..3da3e39 --- /dev/null +++ b/src/Scilab2C/SCI2CTests/Mes_tests/signalProcessing/mainfunctionIfft.sci @@ -0,0 +1,24 @@ +//SCI2C: DEFAULT_PRECISION= DOUBLE + +function mainfunction()
+ +//test ifft + +//real +disp (ifft(4)) + +a=[1 0 5; -2 4 0 ; -4 -2 -1] + +disp (ifft(a)) + + +//complex +disp (ifft(4-2*%i)) + + +b=[1+%i 0+0*%i; 5-2*%i 4+0*%i] + +disp (ifft(b)) + + +endfunction diff --git a/src/Scilab2C/SCI2CTests/Mes_tests/signalProcessing/mainfunctionLev.sci b/src/Scilab2C/SCI2CTests/Mes_tests/signalProcessing/mainfunctionLev.sci new file mode 100644 index 0000000..274567d --- /dev/null +++ b/src/Scilab2C/SCI2CTests/Mes_tests/signalProcessing/mainfunctionLev.sci @@ -0,0 +1,38 @@ +//SCI2C: DEFAULT_PRECISION= DOUBLE + +function mainfunction()
+ +//test lev + +//reals + +b=[1 2 3 4] + +disp(lev(b)) + +[u,v]=lev(b) +disp(u) +disp(v) + +[x,y,z]=lev(b) +disp(x) +disp(y) +disp(z) + +//complexes + +c=[1+2*%i 2 3-3*%i 4+%i] + +disp(lev(c)) + +[uc,vc]=lev(c) +disp(uc) +disp(vc) + +[xc,yc,zc]=lev(c) +disp(xc) +disp(yc) +disp(zc) + + +endfunction |