From: drowe67 Date: Thu, 28 May 2015 20:41:34 +0000 (+0000) Subject: first pass at cellmodem simulation X-Git-Url: http://git.whiteaudio.com/gitweb/?a=commitdiff_plain;h=1ee18217b8151751b708765dcd78a383a32c23ec;p=freetel-svn-tracking.git first pass at cellmodem simulation git-svn-id: https://svn.code.sf.net/p/freetel/code@2162 01035d8c-6547-0410-b346-abe4f91aad63 --- diff --git a/codec2-dev/octave/cellmodem.m b/codec2-dev/octave/cellmodem.m new file mode 100644 index 00000000..5bf7626f --- /dev/null +++ b/codec2-dev/octave/cellmodem.m @@ -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])