aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordrowe67 <[email protected]>2023-11-19 19:11:10 +1030
committerDavid Rowe <[email protected]>2023-11-19 19:11:10 +1030
commitf778670d0c711c4d72d71adcd401997cb603f7c9 (patch)
tree1d63bb1c0aa622a8f45e004a0b25817aeed99ea0
parentdef80d4bf628e55afc31ccd8b9648c0308323b80 (diff)
sinusoidal figure OK
-rw-r--r--doc/codec2.pdfbin120512 -> 138290 bytes
-rw-r--r--doc/codec2.tex15
-rw-r--r--octave/plamp.m7
3 files changed, 15 insertions, 7 deletions
diff --git a/doc/codec2.pdf b/doc/codec2.pdf
index 8aa38ce..663cf83 100644
--- a/doc/codec2.pdf
+++ b/doc/codec2.pdf
Binary files 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);