Files
matlab/common/cic_plot.m
T
jens 6d863f0539 - added cic_plot
git-svn-id: http://moon:8086/svn/matlab/trunk@155 801c6759-fa7c-4059-a304-17956f83a07c
2021-03-23 15:06:39 +00:00

23 lines
366 B
Matlab
Executable File

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)