Skip to content

Commit

Permalink
removed use_line_collection flag from stem plots
Browse files Browse the repository at this point in the history
  • Loading branch information
spors committed Oct 12, 2023
1 parent f90fed5 commit db9fe01
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 22 deletions.
10 changes: 5 additions & 5 deletions filter_design/frequency_sampling_method.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -3713,14 +3713,14 @@
"\n",
"# plot impulse response\n",
"plt.figure(figsize=(10, 3))\n",
"plt.stem(h, use_line_collection=True)\n",
"plt.stem(h )\n",
"plt.title('Impulse response')\n",
"plt.xlabel(r'$k$')\n",
"plt.ylabel(r'$h[k]$')\n",
"# plot transfer functions\n",
"plt.figure(figsize=(10, 3))\n",
"plt.plot(Om, np.abs(H), 'b-', label=r'designed $|H(e^{j \\Omega})|$')\n",
"plt.stem(Ommu, np.abs(Hd), 'g', label=r'desired $|H_d[\\mu]|$', use_line_collection=True)\n",
"plt.stem(Ommu, np.abs(Hd), 'g', label=r'desired $|H_d[\\mu]|$' )\n",
"plt.plot([0, Omc, Omc], [1, 1, 0], 'r--')\n",
"plt.title('Magnitude response of desired/designed filter')\n",
"plt.xlabel(r'$\\Omega$')\n",
Expand Down Expand Up @@ -7096,15 +7096,15 @@
"\n",
"# plot impulse response\n",
"plt.figure(figsize=(10, 3))\n",
"plt.stem(h, use_line_collection=True)\n",
"plt.stem(h )\n",
"plt.title('Impulse response')\n",
"plt.xlabel(r'$k$')\n",
"plt.ylabel(r'$h[k]$')\n",
"# plot frequency response\n",
"plt.figure(figsize=(10, 3))\n",
"plt.plot(Om, np.abs(H), 'b-', label=r'designed $|H(e^{j \\Omega})|$')\n",
"plt.stem(Ommu, np.abs(Hd), 'g',\n",
" label=r'desired $|H_d[\\mu]|$', use_line_collection=True)\n",
" label=r'desired $|H_d[\\mu]|$' )\n",
"plt.plot([0, Omc, Omc], [1, 1, 0], 'r--')\n",
"plt.title('Magnitude response of desired/designed filter')\n",
"plt.xlabel(r'$\\Omega$')\n",
Expand Down Expand Up @@ -10578,7 +10578,7 @@
"\n",
"# plot impulse response\n",
"plt.figure(figsize=(10, 3))\n",
"plt.stem(h, use_line_collection=True)\n",
"plt.stem(h )\n",
"plt.title('Impulse response')\n",
"plt.xlabel(r'$k$')\n",
"plt.ylabel(r'$h[k]$')\n",
Expand Down
4 changes: 2 additions & 2 deletions filter_design/window_method.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -3565,7 +3565,7 @@
"\n",
"# plot impulse response\n",
"plt.figure(figsize=(10, 3))\n",
"plt.stem(h, use_line_collection=True)\n",
"plt.stem(h )\n",
"plt.title('Impulse response')\n",
"plt.xlabel(r'$k$')\n",
"plt.ylabel(r'$h[k]$')\n",
Expand Down Expand Up @@ -7721,7 +7721,7 @@
"\n",
"# plot impulse response\n",
"plt.figure(figsize=(10, 3))\n",
"plt.stem(h1, use_line_collection=True)\n",
"plt.stem(h1 )\n",
"plt.title('Impulse response (rectangular window)')\n",
"plt.xlabel(r'$k$')\n",
"plt.ylabel(r'$h[k]$')\n",
Expand Down
2 changes: 1 addition & 1 deletion quantization/linear_uniform_quantization_error.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -3710,7 +3710,7 @@
" plt.figure(figsize=(10, 6))\n",
" ccf = ccf[N-K-1:N+K-1]\n",
" kappa = np.arange(-len(ccf)//2, len(ccf)//2)\n",
" plt.stem(kappa, ccf, use_line_collection=True)\n",
" plt.stem(kappa, ccf )\n",
" plt.title('Cross-correlation function between input signal and error')\n",
" plt.xlabel(r'$\\kappa$')\n",
" plt.ylabel(r'$\\varphi_{xe}[\\kappa]$')\n",
Expand Down
4 changes: 2 additions & 2 deletions random_signals/independent.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -316,14 +316,14 @@
"plt.figure(figsize=(10, 4))\n",
"\n",
"plt.subplot(121)\n",
"plt.stem(kappa, ccf1, use_line_collection=True)\n",
"plt.stem(kappa, ccf1 )\n",
"plt.xlabel('$\\kappa$')\n",
"plt.ylabel(r'$\\varphi_{xy}[\\kappa]$')\n",
"plt.title('CCF by dot product')\n",
"plt.grid()\n",
"\n",
"plt.subplot(122)\n",
"plt.stem(kappa, np.abs(ccf1-ccf2), use_line_collection=True)\n",
"plt.stem(kappa, np.abs(ccf1-ccf2) )\n",
"plt.xlabel('$\\kappa$')\n",
"plt.title('Difference (magnitude)')\n",
"plt.tight_layout()"
Expand Down
10 changes: 5 additions & 5 deletions random_signals/superposition.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -7548,22 +7548,22 @@
"plt.figure(figsize=(10, 10))\n",
"\n",
"plt.subplot(311)\n",
"plt.stem(y, use_line_collection=True)\n",
"plt.stem(y )\n",
"plt.title('Signal')\n",
"plt.xlabel(r'$k$')\n",
"plt.ylabel(r'$x[k]$')\n",
"plt.axis([0, K, -3, 3])\n",
"\n",
"plt.subplot(312)\n",
"plt.stem(kappa, acf, use_line_collection=True)\n",
"plt.stem(kappa, acf )\n",
"plt.title('ACF of superposition')\n",
"plt.xlabel(r'$\\kappa$')\n",
"plt.ylabel(r'$\\varphi_{yy}[\\kappa]$')\n",
"plt.axis([-K, K, -.75, 1.1*np.max(acf)])\n",
"plt.grid()\n",
"\n",
"plt.subplot(313)\n",
"plt.stem(kappa, ccf, use_line_collection=True)\n",
"plt.stem(kappa, ccf )\n",
"plt.title('CCF between noise and superposition')\n",
"plt.xlabel(r'$\\kappa$')\n",
"plt.ylabel(r'$\\varphi_{ny}[\\kappa]$')\n",
Expand Down Expand Up @@ -10484,14 +10484,14 @@
"plt.figure(figsize=(10, 10))\n",
"\n",
"plt.subplot(311)\n",
"plt.stem(y[0, :100], use_line_collection=True)\n",
"plt.stem(y[0, :100] )\n",
"plt.title('One observation')\n",
"plt.xlabel(r'$k$')\n",
"plt.ylabel(r'$y_0[k]$')\n",
"plt.ylim([-3, 3])\n",
"\n",
"plt.subplot(312)\n",
"plt.stem(xhat[Nmax-1, :100], use_line_collection=True)\n",
"plt.stem(xhat[Nmax-1, :100] )\n",
"plt.title('Average over {:2.0f} observations'.format(Nmax))\n",
"plt.xlabel(r'$k$')\n",
"plt.ylabel(r'$\\hat{x}[k]$')\n",
Expand Down
2 changes: 1 addition & 1 deletion random_signals/white_noise.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"\n",
" # plot ACF\n",
" plt.subplot(122)\n",
" plt.stem(kappa, acf, use_line_collection=True)\n",
" plt.stem(kappa, acf )\n",
" plt.title('Estimated ACF')\n",
" plt.ylabel(r'$\\hat{\\varphi}_{nn}[\\kappa]$')\n",
" plt.xlabel(r'$\\kappa$')\n",
Expand Down
2 changes: 1 addition & 1 deletion recursive_filters/direct_forms.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1184,7 +1184,7 @@
"\n",
"# plot output signal\n",
"plt.figure(figsize=(8, 4))\n",
"plt.stem(h, use_line_collection=True)\n",
"plt.stem(h )\n",
"plt.title('Impulse response')\n",
"plt.xlabel(r'$k$')\n",
"plt.ylabel(r'$h[k]$')\n",
Expand Down
2 changes: 1 addition & 1 deletion recursive_filters/introduction.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4735,7 +4735,7 @@
"plt.title('Phase response')\n",
"# plot impulse response (magnitude)\n",
"plt.figure(figsize=(10, 3))\n",
"plt.stem(20*np.log10(np.abs(np.squeeze(h))), use_line_collection=True)\n",
"plt.stem(20*np.log10(np.abs(np.squeeze(h))) )\n",
"plt.xlabel(r'$k$')\n",
"plt.ylabel(r'$|h[k]|$ in dB')\n",
"plt.grid()\n",
Expand Down
4 changes: 2 additions & 2 deletions recursive_filters/quantization_of_variables.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -4951,7 +4951,7 @@
"\n",
"plt.figure(figsize=(10, 3))\n",
"k = np.arange(1000, 1050)\n",
"plt.stem(k, yQ[k]/Q, use_line_collection=True)\n",
"plt.stem(k, yQ[k]/Q )\n",
"plt.title('Output signal for zero input')\n",
"plt.xlabel(r'$k$')\n",
"plt.ylabel(r'$y_Q[k] / Q$ ')\n",
Expand Down Expand Up @@ -8448,7 +8448,7 @@
"\n",
"plt.figure(figsize=(10, 3))\n",
"k = np.arange(1000, 1050)\n",
"plt.stem(k, yQ[k], use_line_collection=True)\n",
"plt.stem(k, yQ[k] )\n",
"plt.title('Output signal for zero input')\n",
"plt.xlabel(r'$k$')\n",
"plt.ylabel(r'$y_Q[k]$ ')\n",
Expand Down
2 changes: 1 addition & 1 deletion spectral_analysis_deterministic_signals/summary.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1678,7 +1678,7 @@
" '''Plot magnitude spectrum.'''\n",
" plt.axvline(x=P, linewidth=2, color='C1', alpha=.5)\n",
" plt.stem(mu, 20*np.log10(np.abs(X)), basefmt=' ',\n",
" bottom=-300, use_line_collection=True)\n",
" bottom=-300 )\n",
" plt.title(title)\n",
" plt.xlabel(r'$\\mu$')\n",
" plt.axis([0, N, -100, 40])\n",
Expand Down
2 changes: 1 addition & 1 deletion spectral_estimation_random_signals/welch_method.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1499,7 +1499,7 @@
"# plot results\n",
"plt.figure(figsize=(10, 4))\n",
"plt.stem(Om, Pxx, 'C0',\n",
" label=r'$\\hat{\\Phi}_{xx}(e^{j \\Omega})$', basefmt=' ', use_line_collection=True)\n",
" label=r'$\\hat{\\Phi}_{xx}(e^{j \\Omega})$', basefmt=' ' )\n",
"plt.plot(Om, np.ones_like(Pxx), 'C1', label=r'$\\Phi_{xx}(e^{j \\Omega})$')\n",
"plt.title('Estimated and true PSD')\n",
"plt.xlabel(r'$\\Omega$')\n",
Expand Down

0 comments on commit db9fe01

Please sign in to comment.