prototype undersampling code
authordrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Mon, 5 Nov 2012 02:21:35 +0000 (02:21 +0000)
committerdrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Mon, 5 Nov 2012 02:21:35 +0000 (02:21 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@929 01035d8c-6547-0410-b346-abe4f91aad63

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

diff --git a/codec2-dev/octave/undersample.m b/codec2-dev/octave/undersample.m
new file mode 100644 (file)
index 0000000..1bfbf38
--- /dev/null
@@ -0,0 +1,26 @@
+% undersample.m
+% David Rowe 5 Nov 2012
+% Testing algorithms for plotting undersampled data for fdmdv2 waveform displays
+
+fs=fopen("../raw/hts1a.raw","rb");
+s = fread(fs,Inf,"short");
+
+Fs1=8000;
+Fs2=200;
+
+M=Fs1/Fs2;
+
+samples=length(s)/M;
+s1=zeros(1,2*samples);
+for b=1:samples
+    st = (b-1)*M + 1;
+    en = b*M;
+    s1(2*b-1) = max(s(st:en));
+    s1(2*b) = min(s(st:en));
+end
+
+subplot(211)
+plot(s)
+subplot(212)
+plot(s1);
+