Update April
This commit is contained in:
@@ -4,7 +4,6 @@ classdef AWG
|
||||
|
||||
properties(Access=public)
|
||||
|
||||
preset
|
||||
kover %oversampling factor e.g. 16
|
||||
repetitions %repeat the signal to generate a longer sequence?
|
||||
fdac %needed
|
||||
@@ -32,7 +31,6 @@ classdef AWG
|
||||
% Detailed explanation goes here
|
||||
|
||||
arguments
|
||||
options.preset = 'none';
|
||||
options.kover = 16;
|
||||
options.repetitions = 1;
|
||||
options.normalize = 1;
|
||||
@@ -45,6 +43,7 @@ classdef AWG
|
||||
options.lpf_active = 0;
|
||||
options.lpf_type = 0;
|
||||
options.f_cutoff = 32e9;
|
||||
options.H_lpf Filter
|
||||
end
|
||||
|
||||
fn = fieldnames(options);
|
||||
@@ -54,40 +53,34 @@ classdef AWG
|
||||
end
|
||||
end
|
||||
|
||||
if options.preset == "M8196A"
|
||||
% M8196A (92GBd) https://www.keysight.com/us/en/product/M8196A/92-gsa-s-arbitrary-waveform-generators.html
|
||||
obj.dac_max = 0.5;
|
||||
obj.dac_min = -.5;
|
||||
obj.f_cutoff = 50e9;
|
||||
elseif options.preset == "M8199B"
|
||||
%https://www.keysight.com/us/en/assets/3120-1465/data-sheets/M8199A-128-256-GSa-s-Arbitrary-Waveform-Generator.pdf
|
||||
% obj.fdac = 256e9;
|
||||
obj.dac_max = 0.5;
|
||||
obj.dac_min = -.5;
|
||||
obj.f_cutoff = 80e9;
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
function signalclass_out = process(obj,signalclass_in)
|
||||
|
||||
|
||||
len_in = length(signalclass_in.signal);
|
||||
|
||||
% actual processing of the signal (steps 1. - 3.)
|
||||
% 1-3. actual processing of the signal (normalize->quantize->sample hold)
|
||||
signalclass_in.signal = obj.process_(signalclass_in.signal);
|
||||
|
||||
% 4. Apply LPF on the signal
|
||||
if obj.lpf_active
|
||||
lpf = Filter('filtdegree',5,"f_cutoff",obj.f_cutoff,"fsamp",obj.kover*obj.fdac,"filterType",obj.lpf_type);
|
||||
signalclass_in = lpf.process(signalclass_in);
|
||||
if isa(obj.H_lpf,'Filter')
|
||||
%4.A) user already specified a complete filter class when
|
||||
% initializing the AWG module
|
||||
signalclass_in = obj.H_lpf.process(signalclass_in);
|
||||
else
|
||||
%4.B) just use a standard filter
|
||||
lpf = Filter('filtdegree',5,"f_cutoff",obj.f_cutoff,"fsamp",obj.kover*obj.fdac,"filterType",obj.lpf_type);
|
||||
signalclass_in = lpf.process(signalclass_in);
|
||||
end
|
||||
end
|
||||
|
||||
% cast the inform. signal to electrical signal
|
||||
signalclass_in = Electricalsignal(signalclass_in,"fs",obj.fdac*obj.kover,"logbook",signalclass_in.logbook);
|
||||
|
||||
% append to logbook
|
||||
lbdesc = ['AWG preset ', obj.preset, 'k_over:',num2str(obj.kover),'. f_dac:',num2str(obj.fdac*1e-9),'GHz. Resolution:',num2str(obj.bit_resolution),' bits.'];
|
||||
current_class = class(obj);
|
||||
lbdesc = ['AWG ', current_class , '// k_over:',num2str(obj.kover),'. f_dac:',num2str(obj.fdac*1e-9),'GHz. Resolution:',num2str(obj.bit_resolution),' bits.'];
|
||||
signalclass_in = signalclass_in.logbookentry(lbdesc);
|
||||
|
||||
% write to output
|
||||
|
||||
Reference in New Issue
Block a user