CHnages from silas PC

This commit is contained in:
sioe
2024-11-04 09:00:51 +01:00
parent 6dca327d10
commit 9ed763d094
5 changed files with 80 additions and 85 deletions

View File

@@ -344,14 +344,14 @@ classdef Signal
% spectrum_plot(obj.signal,options.fsamp,options.figurename,options.displayname);
N = 2^(nextpow2(length(obj.signal))-10);
N = 2^(nextpow2(length(obj.signal))-2);
if options.normalizeToNyquist==0
[p_lin,w] = pwelch(obj.signal,hanning(N),N/2,N,obj.fs,"centered","power","mean");
w=w.*1e-9;
else
[p_lin,w] = pwelch(obj.signal,hanning(N),N/2,N,"centered","power","mean");
p_lin = smooth(p_lin,0.05,'rloess');
% p_lin = smooth(p_lin,0.05,'rloess');
end
@@ -376,10 +376,10 @@ classdef Signal
if options.normalizeToNyquist==0
xlabel("Frequency in GHz");
%xlim([-obj.fs/2 obj.fs/2].*1e-9)
% xlim([-obj.fs/2 obj.fs/2].*1e-9)
edgetick = 2^(nextpow2(obj.fs*1e-9));
xticks([-edgetick:16:edgetick]);
xlim([100*round( min(w.*1e-9)/100,1)-10,100*round( max(w.*1e-9)/100,1)+10])
xlim([100*round( min(w)/100,1)-10,100*round( max(w)/100,1)+10])
else
xlabel("Normalized Frequency");
xlim([-pi, pi]);

View File

@@ -241,10 +241,14 @@ classdef ChannelFreqResp < handle
xlim([0.2 .5*max(obj.faxis)*1e-9]); grid on;
%%% plot for publication
figure(98989);hold all;box on;title('Magnitude Freq. Response');
xlim([0.2 .5*max(obj.faxis)*1e-9]);
ylim([-20, 2]);
plot(obj.faxis/1e9, 20*log10(abs(Havg)),'LineWidth',2);
figure(1234);hold all;box on;title('Magnitude Freq. Response');
%xlim([0.2 .5*max(obj.faxis)*1e-9]);
ylim([-40, 2]);
Havg_smooth = smooth(Havg,50);
symaxis = (obj.faxis-(obj.f_ref/2))/1e9;
Havg = fftshift(Havg);
Havg = smooth(Havg);
plot(symaxis, 20*log10(abs(Havg)),'LineWidth',0.5);
grid on;