|
|
@@ -53,7 +53,7 @@ clear all;
|
|
|
% ------------------------------------------------------------------------
|
|
|
|
|
|
R = 2; % Decimation factor
|
|
|
-N = 8; % Number of stages
|
|
|
+N = 1; % Number of stages
|
|
|
M = 1; % Differential delay (only 1)
|
|
|
|
|
|
%% ------------------------------------------------------------------------
|
|
|
@@ -194,21 +194,21 @@ end
|
|
|
## grid on;
|
|
|
|
|
|
## ---- Figure #2
|
|
|
-figure('name', 'CIC/FIR Frequency Response (Zoom)', 'Numbertitle', 'off')
|
|
|
- plot(ff, HCICdb - max(HCICdb), '-.', 'LineWidth', 2, 'Color',[0 0 1]);
|
|
|
- hold on;
|
|
|
-
|
|
|
- plot(ff, H_amp, '--', 'LineWidth', 2, 'Color',[0 0.4 0]);
|
|
|
- hold on;
|
|
|
-
|
|
|
- plot(ff, H_comp, '-', 'LineWidth', 2, 'Color',[1 0 0]);
|
|
|
- hold on;
|
|
|
-
|
|
|
- title([{'CIC, Comp. FIR and Result'};{sprintf('Filter Order = %i, Coef. width = %i',NFIR,Bc)}]);
|
|
|
- xlabel ('Freq (\pi x rad / samples)');
|
|
|
- ylabel ('Magnitude (dB)');
|
|
|
- axis([0 1 -300 0]);
|
|
|
- grid on;
|
|
|
+##figure('name', 'CIC/FIR Frequency Response (Zoom)', 'Numbertitle', 'off')
|
|
|
+## plot(ff, HCICdb - max(HCICdb), '-.', 'LineWidth', 2, 'Color',[0 0 1]);
|
|
|
+## hold on;
|
|
|
+##
|
|
|
+## plot(ff, H_amp, '--', 'LineWidth', 2, 'Color',[0 0.4 0]);
|
|
|
+## hold on;
|
|
|
+##
|
|
|
+## plot(ff, H_comp, '-', 'LineWidth', 2, 'Color',[1 0 0]);
|
|
|
+## hold on;
|
|
|
+##
|
|
|
+## title([{'CIC, Comp. FIR and Result'};{sprintf('Filter Order = %i, Coef. width = %i',NFIR,Bc)}]);
|
|
|
+## xlabel ('Freq (\pi x rad / samples)');
|
|
|
+## ylabel ('Magnitude (dB)');
|
|
|
+## axis([0 1 -300 0]);
|
|
|
+## grid on;
|
|
|
|
|
|
%% ------------------------------------------------------------------------
|
|
|
% ---- Passband irregularity
|
|
|
@@ -264,16 +264,16 @@ if (IS_HDR == 'Y')
|
|
|
fclose(fid);
|
|
|
end
|
|
|
|
|
|
-##figure('name','CIC/FIR Frequency Response', 'Numbertitle', 'off')
|
|
|
-##
|
|
|
-## plot(ff, H_amp, '--', 'LineWidth', 2, 'Color',[0 0.4 0]);
|
|
|
-## hold on;
|
|
|
-##
|
|
|
-## title([{'CIC, Comp. FIR and Result'};{sprintf('Filter Order = %i, Coef. width = %i',NFIR,Bc)}]);
|
|
|
-## xlabel ('Freq (\pi x rad / samples)');
|
|
|
-## ylabel ('Magnitude (dB)');
|
|
|
-## axis([0 ff(NFFT)/2 -100 5]);
|
|
|
-## line([Fr Fr], [-400 200], 'LineWidth', 1, 'linestyle', '--', 'Color', [0 0 0]);
|
|
|
-## legend('Comp. FIR','location','northeast');
|
|
|
-## grid on;
|
|
|
+figure('name','CIC/FIR Frequency Response', 'Numbertitle', 'off')
|
|
|
+
|
|
|
+ plot(ff, HCICdb - max(HCICdb), '--', 'LineWidth', 2, 'Color',[0 0.4 0]);
|
|
|
+ hold on;
|
|
|
+
|
|
|
+ title([{'CIC, Comp. FIR and Result'};{sprintf('Filter Order = %i, Coef. width = %i',NFIR,Bc)}]);
|
|
|
+ xlabel ('Freq (\pi x rad / samples)');
|
|
|
+ ylabel ('Magnitude (dB)');
|
|
|
+ axis([0 ff(NFFT)/2 -100 5]);
|
|
|
+ line([Fr Fr], [-400 200], 'LineWidth', 1, 'linestyle', '--', 'Color', [0 0 0]);
|
|
|
+ legend('Comp. FIR','location','northeast');
|
|
|
+ grid on;
|
|
|
|