minor changes büro
This commit is contained in:
@@ -168,19 +168,22 @@ classdef Signal
|
||||
fig = findall(groot, 'Type', 'figure', 'Name', 'power density');
|
||||
if isvalid(fig)
|
||||
fig = get(fig);
|
||||
ax = gca;
|
||||
hold on
|
||||
else
|
||||
figure('name','power density');
|
||||
ax = gca;
|
||||
end
|
||||
else
|
||||
fig = findall(groot, 'Type', 'figure', 'Name', options.figurename);
|
||||
if isvalid(fig)
|
||||
fig = get(fig);
|
||||
ax = fig.CurrentAxes;
|
||||
hold on
|
||||
else
|
||||
figure('name',options.figurename);
|
||||
ax = gca;
|
||||
hold on
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
|
||||
@@ -200,10 +203,12 @@ classdef Signal
|
||||
psd = psd/length(Fsignal);
|
||||
|
||||
%smoothing
|
||||
psd = smooth(psd,100);
|
||||
psd = smooth(psd,50);
|
||||
|
||||
psd_plot = 20*log10(psd);
|
||||
|
||||
psd_plot(psd_plot<-120) = -120;
|
||||
|
||||
|
||||
testParseval = 1;
|
||||
if testParseval == 1
|
||||
@@ -225,9 +230,9 @@ classdef Signal
|
||||
|
||||
|
||||
if ~isempty(options.displayname)
|
||||
plot(freq_vec*1e-9,psd_plot,'Linewidth',0.5,'DisplayName',options.displayname);
|
||||
plot(freq_vec*1e-9,psd_plot,'Linewidth',0.5,'DisplayName',options.displayname,'Parent',ax);
|
||||
else
|
||||
plot(freq_vec*1e-9,psd_plot,'Linewidth',0.5);
|
||||
plot(freq_vec*1e-9,psd_plot,'Linewidth',0.5,'Parent',ax);
|
||||
end
|
||||
|
||||
xlabel('Frequency [GHz]')
|
||||
@@ -235,9 +240,9 @@ classdef Signal
|
||||
%Wavelength Axis
|
||||
freq_vec = physconst('LightSpeed')*linspace(-fsamp/2,fsamp/2,length(psd))./((physconst('LightSpeed')/1550e-9)^2);
|
||||
if ~isempty(options.displayname)
|
||||
plot(freq_vec*1e9,psd_plot,'Linewidth',0.5,'DisplayName',options.displayname);
|
||||
plot(freq_vec*1e9,psd_plot,'Linewidth',0.5,'DisplayName',options.displayname,'Parent',ax);
|
||||
else
|
||||
plot(freq_vec*1e9,psd_plot,'Linewidth',0.5);
|
||||
plot(freq_vec*1e9,psd_plot,'Linewidth',0.5,'Parent',ax);
|
||||
end
|
||||
|
||||
xlabel('Wavelength [nm]')
|
||||
|
||||
@@ -175,14 +175,14 @@ classdef Filter
|
||||
% hold on
|
||||
% plot(w/(2*pi)*obj.fsamp*1e-9,20*log10(abs(H)),'LineWidth',3);
|
||||
% ax = gca;
|
||||
% ylim([-6 0])
|
||||
% %ylim([-6 0])
|
||||
% grid on
|
||||
% xlabel('Freq in GHz')
|
||||
% ylabel('Magnitude (dB)')
|
||||
|
||||
|
||||
% freqz(B, A)
|
||||
%hfvt = fvtool(B,A);
|
||||
% freqz(B, A, 2048, obj.fsamp);
|
||||
% hfvt = fvtool(B,A);
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -56,6 +56,7 @@ classdef Photodiode
|
||||
% Magnitude squared detection
|
||||
yout = sum( abs(xin) .^2*obj.responsivity, 2 ) ;
|
||||
|
||||
|
||||
% Shot Noise
|
||||
shot_noise = sqrt(k * obj.fsimu .* yout) .* randn(size(yout,1),1);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user