aboutsummaryrefslogtreecommitdiff
path: root/octave/hp_filt.m
diff options
context:
space:
mode:
Diffstat (limited to 'octave/hp_filt.m')
-rw-r--r--octave/hp_filt.m12
1 files changed, 12 insertions, 0 deletions
diff --git a/octave/hp_filt.m b/octave/hp_filt.m
new file mode 100644
index 0000000..1087bb9
--- /dev/null
+++ b/octave/hp_filt.m
@@ -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