From f778670d0c711c4d72d71adcd401997cb603f7c9 Mon Sep 17 00:00:00 2001 From: drowe67 Date: Sun, 19 Nov 2023 19:11:10 +1030 Subject: sinusoidal figure OK --- doc/codec2.pdf | Bin 120512 -> 138290 bytes doc/codec2.tex | 15 ++++++++------- octave/plamp.m | 7 +++++++ 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/doc/codec2.pdf b/doc/codec2.pdf index 8aa38ce..663cf83 100644 Binary files a/doc/codec2.pdf and b/doc/codec2.pdf differ diff --git a/doc/codec2.tex b/doc/codec2.tex index 5719601..ae01ae7 100644 --- a/doc/codec2.tex +++ b/doc/codec2.tex @@ -87,10 +87,11 @@ A sinewave will cause a spike or spectral line on a spectrum plot, so we can see (#1+2*#3,#2+0)} } -% three sine wave sources -\draw (0, 2.0) circle (0.5); \drawSine{0}{ 2.0}{0.2}{0.2}; -\draw (0, 0.5) circle (0.5); \drawSine{0}{ 0.5}{0.2}{0.2}; -\draw (0,-1.5) circle (0.5); \drawSine{0}{-1.5}{0.2}{0.2}; +% sine wave sources +\draw (0, 2.0) circle (0.5); \drawSine{0}{ 2.0}{0.2}{0.2}; \draw (-2.0,2.0) node {$A_1, F_0$ Hz}; +\draw (0, 0.5) circle (0.5); \drawSine{0}{ 0.5}{0.2}{0.2}; \draw (-2.0,0.5) node {$A_2, 2F_0$ Hz}; +\draw (0,-2.5) circle (0.5); \drawSine{0}{-2.5}{0.2}{0.2}; \draw (-2.0,-2.5) node {$A_L, LF_0$ Hz}; +\draw [dotted,thick] (0,0) -- (0,-2); % summer \draw (2.5,2) circle (0.5); @@ -100,11 +101,11 @@ A sinewave will cause a spike or spectral line on a spectrum plot, so we can see % connecting lines \draw [->] (0.5,2) -- (2,2); \draw [->] (0.45,0.7) -- (2.05,1.8); -\draw [->] (0.3,-1.1) -- (2.2,1.6); +\draw [->] (0.3,-2.1) -- (2.2,1.6); -% output +% output speec \draw [->] (3,2) -- (4,2); - +\draw [xshift=4.2cm,yshift=2cm,color=blue] plot[smooth] file {hts2a_37_sn.txt}; \end{tikzpicture} \end{center} diff --git a/octave/plamp.m b/octave/plamp.m index e32d102..6f0478f 100644 --- a/octave/plamp.m +++ b/octave/plamp.m @@ -92,6 +92,13 @@ function plamp(samname, f, epslatex=0) fn = sprintf("%s_%d_sn.tex",samname,f); print(fn,"-depslatex",sz); printf("\nprinting... %s\n", fn); + % file of points to plot in sinusoidal model + fn = sprintf("%s_%d_sn.txt",samname,f); + t_length = 4; s_max = 2; s=s*s_max/max(abs(s)); + N = length(s); t = (0:N-1)*t_length/N; + s_save = [t' s']; size(s_save) + save("-ascii",fn,"s_save"); printf("printing... %s\n", fn); + figure(2); fn = sprintf("%s_%d_sw.tex",samname,f); print(fn,"-depslatex",sz); printf("printing... %s\n", fn); -- cgit v1.2.3