From octave-sources-request at bevo dot che dot wisc dot edu Tue May 2 19:58:24 2000 Subject: Signal tests From: "Billinghurst, David (CRTS)" To: octave-sources at bevo dot che dot wisc dot edu Date: Wed, 3 May 2000 00:58:16 -0000 This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_000_01BFB49A.ABC28FE2 Content-Type: text/plain Attached are some tests for test/octave.test/signal. Tested on 0ctave-2.1.30 under mips-sgi-irix6.5 and i586-pc-cygwin +++++++++++++++++++++++++++++++++++++++++ (Mr) David Billinghurst Comalco Research Centre PO Box 316, Thomastown, Vic, Australia, 3074 Phone: +61 3 9469 0642 FAX: +61 3 9462 2700 Email: David dot Billinghurst at riotinto dot com dot au <> <> <> <> <> <> <> <> ------_=_NextPart_000_01BFB49A.ABC28FE2 Content-Type: application/octet-stream; name="detrend-1.m" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="detrend-1.m" ## detrend-1.m=0A= ##=0A= ## Author: David Billinghurst (David dot Billinghurst at riotinto dot com dot au)=0A= ## Comalco Research and Technology=0A= ## 02 May 2000=0A= N=3D32;=0A= x =3D (0:1:N-1)/N + 2;=0A= y =3D detrend(x);=0A= all (all (abs (y) < 10*eps))=0A= ------_=_NextPart_000_01BFB49A.ABC28FE2 Content-Type: application/octet-stream; name="detrend-2.m" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="detrend-2.m" ## detrend-2.m=0A= ##=0A= ## Author: David Billinghurst (David dot Billinghurst at riotinto dot com dot au)=0A= ## Comalco Research and Technology=0A= ## 02 May 2000=0A= N=3D32;=0A= t =3D (0:1:N-1)/N;=0A= x =3D t .* t + 2;=0A= y =3D detrend(x,2);=0A= all (all (abs (y) < 30*eps))=0A= ------_=_NextPart_000_01BFB49A.ABC28FE2 Content-Type: application/octet-stream; name="detrend-3.m" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="detrend-3.m" ## detrend-3.m=0A= ##=0A= ## Author: David Billinghurst (David dot Billinghurst at riotinto dot com dot au)=0A= ## Comalco Research and Technology=0A= ## 02 May 2000=0A= N=3D32;=0A= t =3D (0:1:N-1)/N;=0A= x =3D [t;4*t-3]';=0A= y =3D detrend(x);=0A= all (all (abs (y) < 10*eps))=0A= ------_=_NextPart_000_01BFB49A.ABC28FE2 Content-Type: application/octet-stream; name="fft-1.m" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="fft-1.m" ## fft-1.m=0A= ##=0A= ## Author: David Billinghurst (David dot Billinghurst at riotinto dot com dot au)=0A= ## Comalco Research and Technology=0A= ## 02 May 2000=0A= N=3D64;=0A= n=3D4;=0A= t =3D 2*pi*(0:1:N-1)/N;=0A= s =3D cos(n*t);=0A= S =3D fft(s);=0A= =0A= answer =3D 0*t;=0A= answer(n+1) =3D N/2;=0A= answer(N-n+1) =3D N/2;=0A= =0A= all( abs(S-answer) < 4*N*eps )=0A= ------_=_NextPart_000_01BFB49A.ABC28FE2 Content-Type: application/octet-stream; name="fft2-1.m" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="fft2-1.m" ## fft2-1.m=0A= ##=0A= ## Author: David Billinghurst (David dot Billinghurst at riotinto dot com dot au)=0A= ## Comalco Research and Technology=0A= ## 02 May 2000=0A= M=3D16;=0A= N=3D8;=0A= =0A= m=3D5;=0A= n=3D3;=0A= =0A= x =3D 2*pi*(0:1:M-1)/M;=0A= y =3D 2*pi*(0:1:N-1)/N;=0A= sx =3D cos(m*x);=0A= sy =3D sin(n*y);=0A= s=3Dkron(sx',sy);=0A= S =3D fft2(s);=0A= answer =3D kron(fft(sx)',fft(sy));=0A= all( all( abs(S-answer) < 4*M*N*eps ) )=0A= ------_=_NextPart_000_01BFB49A.ABC28FE2 Content-Type: application/octet-stream; name="ifft-1.m" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="ifft-1.m" ## ifft-1.m=0A= ##=0A= ## Author: David Billinghurst (David dot Billinghurst at riotinto dot com dot au)=0A= ## Comalco Research and Technology=0A= ## 02 May 2000=0A= N=3D64;=0A= n=3D7;=0A= t =3D 2*pi*(0:1:N-1)/N;=0A= s =3D cos(n*t);=0A= =0A= S =3D 0*t;=0A= S(n+1) =3D N/2;=0A= S(N-n+1) =3D N/2;=0A= =0A= all( abs(ifft(S)-s) < 4*N*eps )=0A= ------_=_NextPart_000_01BFB49A.ABC28FE2 Content-Type: application/octet-stream; name="ifft2-1.m" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="ifft2-1.m" ## ifft2-1.m=0A= ##=0A= ## Author: David Billinghurst (David dot Billinghurst at riotinto dot com dot au)=0A= ## Comalco Research and Technology=0A= ## 02 May 2000=0A= M=3D12;=0A= N=3D7;=0A= =0A= m=3D3;=0A= n=3D2;=0A= =0A= x =3D 2*pi*(0:1:M-1)/M;=0A= y =3D 2*pi*(0:1:N-1)/N;=0A= =0A= sx =3D cos(m*x);=0A= sy =3D cos(n*y);=0A= =0A= S =3D kron(fft(sx)',fft(sy));=0A= answer=3Dkron(sx',sy);=0A= s =3D ifft2(S);=0A= =0A= all( all( abs(s-answer) < 30*eps ) )=0A= ------_=_NextPart_000_01BFB49A.ABC28FE2 Content-Type: application/octet-stream; name="signal.exp" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="signal.exp" ## The following functions need to have tests written for them:=0A= =0A= # detrend=0A= =0A= set test detrend-1=0A= set prog_output "ans =3D 1"=0A= do_test detrend-1.m=0A= =0A= set test detrend-2=0A= set prog_output "ans =3D 1"=0A= do_test detrend-2.m=0A= =0A= set test detrend-3=0A= set prog_output "ans =3D 1"=0A= do_test detrend-3.m=0A= =0A= # fft=0A= =0A= set test fft-1=0A= set prog_output "ans =3D 1"=0A= do_test fft-1.m=0A= =0A= # ifft=0A= =0A= set test ifft-1=0A= set prog_output "ans =3D 1"=0A= do_test ifft-1.m=0A= =0A= # fft2=0A= =0A= set test fft2-1=0A= set prog_output "ans =3D 1"=0A= do_test fft2-1.m=0A= =0A= # ifft2=0A= =0A= set test ifft2-1=0A= set prog_output "ans =3D 1"=0A= do_test ifft2-1.m=0A= =0A= # fftconv=0A= # fftfilt=0A= # filter=0A= # freqz=0A= # sinc=0A= ------_=_NextPart_000_01BFB49A.ABC28FE2-- ----------------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.che.wisc.edu/octave/octave.html How to fund new projects: http://www.che.wisc.edu/octave/funding.html Subscription information: http://www.che.wisc.edu/octave/archive.html -----------------------------------------------------------------------