From: drowe67 Date: Tue, 12 Jun 2012 05:09:39 +0000 (+0000) Subject: rename tget_spec to be in line with function name X-Git-Url: http://git.whiteaudio.com/gitweb/?a=commitdiff_plain;h=e9c24b4b065c0be35eede17c08abee8a7ac48e65;p=freetel-svn-tracking.git rename tget_spec to be in line with function name git-svn-id: https://svn.code.sf.net/p/freetel/code@544 01035d8c-6547-0410-b346-abe4f91aad63 --- diff --git a/codec2-dev/octave/tfft_log.m b/codec2-dev/octave/tfft_log.m deleted file mode 100644 index 89364968..00000000 --- a/codec2-dev/octave/tfft_log.m +++ /dev/null @@ -1,49 +0,0 @@ -% tfft_log.m -% -% Used in conjunction swith src/fdmdv_demod to test the -% fdmdv_get_rx_spectrum() function. -% -% codec2-dev/src$ ./fdmdv_demod fdmdv_mod.raw tmp.c2 dump.txt -% octave:3> tfft_log("../src/dump.txt") -% -% Copyright David Rowe 2012 -% This program is distributed under the terms of the GNU General Public License -% Version 2 -% - -function tfft_log(dumpfilename) - - load(dumpfilename); - - [rows cols] = size(rx_spec_log_c); - Fs = 8000; low_freq = 0; high_freq = 2500; - res = (Fs/2)/cols; - st_bin = low_freq/res + 1; - en_bin = high_freq/res; - xaxis = (st_bin:en_bin)*res; - - f_start = 2; f_end = 100; - beta = 0.1; - - av = zeros(f_end, en_bin-st_bin+1); - for r=f_start:f_end - x = (1-beta)*av(r-1,:) + beta*rx_spec_log_c(r,st_bin:en_bin); - av(r,:) = x; - end - - % spectrogram (waterfall) - - figure(1) - clf; - imagesc(av,[-40 0]); - - % animated spectrum display - - figure(2) - clf; - for r=f_start:f_end - plot(xaxis, av(r,:)) - axis([ low_freq high_freq -40 0]) - sleep(0.1) - end -endfunction diff --git a/codec2-dev/octave/tget_spec.m b/codec2-dev/octave/tget_spec.m new file mode 100644 index 00000000..e46c1ea0 --- /dev/null +++ b/codec2-dev/octave/tget_spec.m @@ -0,0 +1,49 @@ +% tget-spec.m +% +% Used in conjunction with src/fdmdv_demod to test the +% fdmdv_get_rx_spectrum() function. +% +% codec2-dev/src$ ./fdmdv_demod fdmdv_mod.raw tmp.c2 dump.txt +% octave:3> tget_spec("../src/dump.txt") +% +% Copyright David Rowe 2012 +% This program is distributed under the terms of the GNU General Public License +% Version 2 +% + +function tfft_log(dumpfilename) + + load(dumpfilename); + + [rows cols] = size(rx_spec_log_c); + Fs = 8000; low_freq = 0; high_freq = 2500; + res = (Fs/2)/cols; + st_bin = low_freq/res + 1; + en_bin = high_freq/res; + xaxis = (st_bin:en_bin)*res; + + f_start = 2; f_end = 100; + beta = 0.1; + + av = zeros(f_end, en_bin-st_bin+1); + for r=f_start:f_end + x = (1-beta)*av(r-1,:) + beta*rx_spec_log_c(r,st_bin:en_bin); + av(r,:) = x; + end + + % spectrogram (waterfall) + + figure(1) + clf; + imagesc(av,[-40 0]); + + % animated spectrum display + + figure(2) + clf; + for r=f_start:f_end + plot(xaxis, av(r,:)) + axis([ low_freq high_freq -40 0]) + sleep(0.1) + end +endfunction diff --git a/codec2-dev/src/fdmdv.c b/codec2-dev/src/fdmdv.c index 2e88d1d4..3526e780 100644 --- a/codec2-dev/src/fdmdv.c +++ b/codec2-dev/src/fdmdv.c @@ -1377,7 +1377,7 @@ void CODEC2_WIN32SUPPORT fdmdv_48_to_8(float out8k[], float in48k[], int n) FDMDV_NSPEC. Note that a 2*FDMDV_NSPEC size FFT is reqd to get FDMDV_NSPEC output points. FDMDV_NSPEC must be a power of 2. - See octave/tfft_log.m for a demo real time spectral display using + See octave/tget_spec.m for a demo real time spectral display using Octave. This demo averages the output over time to get a smoother display: