Octave function to high pass filter araw speech file
authordrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Sat, 25 Feb 2012 05:20:00 +0000 (05:20 +0000)
committerdrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Sat, 25 Feb 2012 05:20:00 +0000 (05:20 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@323 01035d8c-6547-0410-b346-abe4f91aad63

codec2-dev/octave/hp_filt.m [new file with mode: 0644]

diff --git a/codec2-dev/octave/hp_filt.m b/codec2-dev/octave/hp_filt.m
new file mode 100644 (file)
index 0000000..1087bb9
--- /dev/null
@@ -0,0 +1,12 @@
+% hp_filt.m
+% David Rowe 20 Feb 2012
+
+function hp_filt(in_file, out_file)
+  fin = fopen(in_file,"rb");
+  s = fread(fin,Inf,"short");
+  b = fir1(256, 300/4000, "high");
+  freqz(b);
+  s_hpf = filter(b,1,s);
+  fout = fopen(out_file,"wb");
+  fwrite(fout, s_hpf, "short");
+endfunction