Merge branch 'main' of cau-git.rz.uni-kiel.de:nt/mitarbeiter/silas/imdd_simulation
# Conflicts: # Classes/04_DSP/Equalizer/FFE_adaptive_decision.m
This commit is contained in:
59
Classes/04_DSP/CIC_filter.m
Normal file
59
Classes/04_DSP/CIC_filter.m
Normal file
@@ -0,0 +1,59 @@
|
||||
% Moving Average filter
|
||||
N = 7;
|
||||
xn = sin(2*pi*[0:.1:10]);
|
||||
hn = ones(1,N);
|
||||
y1n = conv(xn,hn) .* 1/N;
|
||||
|
||||
% transfer function of Moving Average filter
|
||||
figure()
|
||||
hF = fft(hn,1024);
|
||||
plot([-512:511]/1024, abs(fftshift(hF)));
|
||||
xlabel('Normalized frequency')
|
||||
ylabel('Amplitude')
|
||||
title('frequency response of Moving average filter')
|
||||
|
||||
% Implementing Cascaded Integrator Comb filter with the
|
||||
% comb section following the integrator stage
|
||||
N = 10;
|
||||
delayBuffer = zeros(1,N);
|
||||
intOut = 0;
|
||||
xn = sin(2*pi*[0:.1:10]);
|
||||
for ii = 1:length(xn)
|
||||
% comb section
|
||||
combOut = xn(ii) - delayBuffer(end);
|
||||
delayBuffer(2:end) = delayBuffer(1:end-1);
|
||||
delayBuffer(1) = xn(ii);
|
||||
|
||||
% integrator
|
||||
intOut = intOut + combOut;
|
||||
y2n(ii) = intOut;
|
||||
end
|
||||
|
||||
err12 = y1n(1:length(xn)) - y2n;
|
||||
err12dB = 10*log10(err12*err12'/length(err12)); % identical outputs
|
||||
|
||||
|
||||
% Implementing Cascaded Integrator Comb filter with the
|
||||
% integrator section following the comb stage
|
||||
|
||||
N = 10;
|
||||
delayBuffer = zeros(1,N);
|
||||
intOut = 0;
|
||||
xn = sin(2*pi*[0:.1:10]);
|
||||
for ii = 1:length(xn)
|
||||
% integrator
|
||||
intOut = intOut + xn(ii);
|
||||
% comb section
|
||||
combOut = intOut - delayBuffer(end);
|
||||
delayBuffer(2:end) = delayBuffer(1:end-1);
|
||||
delayBuffer(1) = intOut;
|
||||
y3n(ii) = combOut;
|
||||
|
||||
end
|
||||
err13 = y1n(1:length(xn)) - y3n;
|
||||
err13dB = 10*log10(err13*err13'/length(err13)); % identical outputs
|
||||
|
||||
figure()
|
||||
hold on
|
||||
plot(xn)
|
||||
plot(y1n)
|
||||
@@ -108,7 +108,7 @@ classdef Duobinary
|
||||
data = data - b;
|
||||
data = data ./ 2;
|
||||
|
||||
assert(isequal((0:M-1)',unique(data)),'Check Duobinary Precoding'); %seems the signal is not unipolar
|
||||
% assert(isequal((0:M-1)',unique(data)),'Check Duobinary Precoding'); %seems the signal is not unipolar
|
||||
|
||||
% duobinary coding (1+D)
|
||||
% coeff = [1,1];
|
||||
|
||||
Reference in New Issue
Block a user