first pass at cellmodem simulation
authordrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Thu, 28 May 2015 20:41:34 +0000 (20:41 +0000)
committerdrowe67 <drowe67@01035d8c-6547-0410-b346-abe4f91aad63>
Thu, 28 May 2015 20:41:34 +0000 (20:41 +0000)
git-svn-id: https://svn.code.sf.net/p/freetel/code@2162 01035d8c-6547-0410-b346-abe4f91aad63

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

diff --git a/codec2-dev/octave/cellmodem.m b/codec2-dev/octave/cellmodem.m
new file mode 100644 (file)
index 0000000..5bf7626
--- /dev/null
@@ -0,0 +1,50 @@
+% cellmodem.m
+% David Rowe May 2005
+%
+% Simulation of modem for low rate date through a cell phone codec
+%
+% Ideas:
+%   + insert low rate codec
+%   + generate bunch of symbols, run through codec, measure MSE, choose best set
+%   + start with cmd line version of codec, frame synchronous
+%   + add symbol timing estimator later
+%   + try different frame rates
+%   + simulate impairments like HP/LP filtering.  Can we correct for this?
+%   + pilots symbols so we can use energy as well?
+%   + set of F0 as well
+
+graphics_toolkit ("gnuplot");
+lsp;
+
+lpc_order = 4;
+Fs = 8000;
+fo = 100;             % pitch frequency of voice 
+wo = 2*pi*fo/Fs;      % pitch in rads
+N  = Fs*0.04;         % frame length
+
+% construct LSP symbol
+
+w = [0.1 0.4  0.5 0.8]*pi
+
+% synthesise speech signal
+
+a=lsptoa(w)
+l=pi/wo;
+ex = zeros(1,N);
+for m=1:l
+    ex += cos(wo*m*(1:N));
+end
+s = filter(1, a, ex);
+
+% extract received symbol from channel
+
+a_ = lpcauto(s, lpc_order)
+w_ = atolsp(a_)
+
+figure(1);
+clf;
+subplot(211)
+plot(s)
+subplot(212)
+plot(w,'g+',w_','r+');
+axis([0 lpc_order+1 0 pi])