WIP Büro
This commit is contained in:
@@ -151,14 +151,38 @@ classdef Filter
|
||||
|
||||
faxis=linspace(-obj.fsamp/2,obj.fsamp/2,blocklen+1)';%generates arow vector faxis of blocklen+1 points linearly spaced between and including -para.fs/2 and para.fs/2
|
||||
faxis=ifftshift(faxis(1:end-1));
|
||||
|
||||
|
||||
H=exp(-((faxis)/(obj.f_cutoff*2)).^(2*obj.filtdegree)*log(2)*2^(2*obj.filtdegree-1));
|
||||
|
||||
% figure()
|
||||
% hold on
|
||||
% xline(obj.f_cutoff*1e-9,'LineWidth',3,LineStyle='--');
|
||||
% xline(-obj.f_cutoff*1e-9,'LineWidth',3,LineStyle='--');
|
||||
% plot(faxis*1e-9,20*log10(abs(H)),'LineWidth',3);
|
||||
% ax = gca;
|
||||
% ylim([-6 0])
|
||||
% grid on
|
||||
% xlabel('Freq in GHz')
|
||||
% ylabel('Magnitude (dB)')
|
||||
|
||||
end
|
||||
|
||||
% Build Filter from coefficients
|
||||
if filterType ~= 10
|
||||
[H,w] = freqz(B, A, obj.signal_length,'whole');
|
||||
|
||||
|
||||
% figure()
|
||||
% hold on
|
||||
% plot(w/(2*pi)*obj.fsamp*1e-9,20*log10(abs(H)),'LineWidth',3);
|
||||
% ax = gca;
|
||||
% ylim([-6 0])
|
||||
% grid on
|
||||
% xlabel('Freq in GHz')
|
||||
% ylabel('Magnitude (dB)')
|
||||
|
||||
|
||||
% freqz(B, A)
|
||||
%hfvt = fvtool(B,A);
|
||||
end
|
||||
|
||||
end
|
||||
@@ -167,7 +191,12 @@ classdef Filter
|
||||
function show(obj)
|
||||
obj.signal_length = 1024;
|
||||
[H,w] = obj.buildFilter(obj.filterType);
|
||||
plot(w,20*log10(abs(H)))
|
||||
plot(w/pi,20*log10(abs(H)));
|
||||
ax = gca;
|
||||
ax.XTick = 0:.5:2;
|
||||
grid on
|
||||
xlabel('Normalized Frequency (\times\pi rad/sample)')
|
||||
ylabel('Magnitude (dB)')
|
||||
%freqz(H);
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user