From 6d863f05391b6f17338a69fb80848e826a13d663 Mon Sep 17 00:00:00 2001 From: Jens Ahrensfeld Date: Tue, 23 Mar 2021 15:06:39 +0000 Subject: [PATCH] - added cic_plot git-svn-id: http://moon:8086/svn/matlab/trunk@155 801c6759-fa7c-4059-a304-17956f83a07c --- common/cic_plot.m | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 common/cic_plot.m diff --git a/common/cic_plot.m b/common/cic_plot.m new file mode 100755 index 0000000..5bbd358 --- /dev/null +++ b/common/cic_plot.m @@ -0,0 +1,23 @@ +function cic_plot(M, N, R) +% cic_plot(M, N, R) + +ns = 1000; +f = 2*(1:ns)/ns; +H = abs(sin(pi*M.*f)./sin(pi.*f/R)).^N; + +subplot(2,1,1) +plot(f,H); +xlabel('f / fs'); +ylabel('G'); +grid; + +Gain = (R*M)^N +BitGrowth = ceil(N*log2(R*M)) + +subplot(2,1,2) +plot(f,20*log10(H/Gain)); +xlabel('f / fs'); +ylabel('A/dB'); +grid; + +Atten_fs2 = 20*log10(H(ns/2)/Gain) \ No newline at end of file