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]')
|
||||
|
||||
Reference in New Issue
Block a user