Electronics > Beginners
Measuring bandwidth/bode plot DS1074Z/SDG2042X
(1/1)
kim.dd:
Hi all I am playing arround with a Siglent SDG2042X and a DS1074Z.
I was trying to create a bode plot script in scilab, but was getting unexpected data.

So what I did was hookup the siggen on the Rigol and measure the response from 1..100MHz in 1Mhz steps:





Cable 1 is the one included with the SDG2042X.
Cable 2 is from Batronix CFL200.
Drop down at the end is about -10db/decade arround the -3db point.

Both devices are unlocked to maximum bandwidth.
Is this because I didn't terminate (50ohm) at the scope end? I didn't expect this below 100MHz.
Or did unlock backfire and is the DS1074Z defaulting to 50Mhz (system info shows DS1104Z and option for bandwidth 100mhz offcial).
The SDG2042X normally has a bandwidth for sines of 40MHz, but is unlocked and shows SDG2122X and allows upto 120MHz.

Scilab script:

--- Code: ---clear;
format("v",20);

// Cable 1 => Siglent SDG 2042X included cable, markings 3D-FB
// Cable 2 => Batronix BNC-Cable CLF200, 50 Ω, 1m, markings CLF-200 LOW LOSS 50 OHM COAXIAL CABLE
// 0 => SDG2042X:CH1->DS1074Z:CH1 (Cable 1), SDG2042X:CH2->DS1074Z:CH2 (Cable 2)
// 1 => SDG2042X:CH1->DS1074Z:CH2 (Cable 1), SDG2042X:CH2->DS1074Z:CH1 (Cable 2)
// 2 => SDG2042X:CH2->DS1074Z:CH1 (Cable 1), SDG2042X:CH1->DS1074Z:CH2 (Cable 2)
swap = 2;

[status, deviceAddrs] = findAllInstruments();
[status, defaultRM] = viOpenDefaultRM();
[status, wavegen_id] = viOpen( defaultRM, deviceAddrs(1), viGetDefinition("VI_NULL"), viGetDefinition("VI_NULL"));
[status, scope_id] = viOpen( defaultRM, deviceAddrs(2), viGetDefinition("VI_NULL"), viGetDefinition("VI_NULL"));

[status, count] = viWrite(wavegen_id, "*IDN?");
[status, wavegen_idn, count] = viRead(wavegen_id, 255);

[status, count] = viWrite(scope_id, "*IDN?");
[status, scope_idn, count] = viRead(scope_id, 255);

[status, count] = viWrite(wavegen_id, "C1:OUTP LOAD,HZ,PLRT,NOR,WVTP,SINE");
[status, count] = viWrite(wavegen_id, "C1:BSWV AMP,1V,OFST,0V,PHSE,0");
[status, count] = viWrite(wavegen_id, "C1:BSWV FRQ,10000000HZ");
[status, count] = viWrite(wavegen_id, "C1:OUTP ON");
[status, count] = viWrite(wavegen_id, "C2:OUTP ON");

[status, count] = viWrite(scope_id, ":ACQ:TYPE HRES");

[status, count] = viWrite(scope_id, ":CHAN1:BWL OFF");
[status, count] = viWrite(scope_id, ":CHAN1:COUP DC");
[status, count] = viWrite(scope_id, ":CHAN1:DISP ON");
[status, count] = viWrite(scope_id, ":CHAN1:PROB 1");

[status, count] = viWrite(scope_id, ":CHAN2:BWL OFF");
[status, count] = viWrite(scope_id, ":CHAN2:COUP DC");
[status, count] = viWrite(scope_id, ":CHAN2:DISP ON");
[status, count] = viWrite(scope_id, ":CHAN2:PROB 1");

[status, count] = viWrite(scope_id, ":MEAS:STAT:ITEM VPP,CHAN1");
[status, count] = viWrite(scope_id, ":MEAS:STAT:ITEM VPP,CHAN2");
[status, count] = viWrite(scope_id, ":MEAS:STAT:ITEM RPH,CHAN12");

function set_freq(f)
    disp(string(f));
    [status, count] = viWrite(wavegen_id, strcat(["C1:BSWV FRQ,",string(f),"HZ"]));
    [status, count] = viWrite(scope_id, strcat([":TIM:MAIN:SCAL ",string(0.5/f)]));
    sleep(2500);
    [status, count] = viWrite(scope_id, ":MEAS:STAT:RES");
    sleep(250);
endfunction

function value = get_vpp1()
    [status, count] = viWrite(scope_id, ":MEAS:ITEM? VPP,CHAN1");
    [status, value, count] = viRead(scope_id, 255);
    value = strtod(value);
endfunction

function value = get_vpp2()
    [status, count] = viWrite(scope_id, ":MEAS:ITEM? VPP,CHAN2");
    [status, value, count] = viRead(scope_id, 255);
    value = strtod(value);
endfunction

function value = get_phase12()
    [status, count] = viWrite(scope_id, ":MEAS:ITEM? RPH,CHAN12");
    [status, value, count] = viRead(scope_id, 255);
    value = strtod(value);
endfunction

delta = 1000000;
n = 100;
freq_set = zeros(n,1);
amp1 = zeros(freq_set);
amp2 = zeros(freq_set);
amp1_db = zeros(freq_set);
amp2_db = zeros(freq_set);
phase = zeros(freq_set);

for k=1:n
    freq_set(k) = delta*k;
    set_freq(freq_set(k));
    amp1(k) = mean([get_vpp1(),get_vpp1(),get_vpp1()]);
    amp2(k) = mean([get_vpp2(),get_vpp2(),get_vpp2()]);
    phase(k) = mean([get_phase12(),get_phase12(),get_phase12()]);
    amp1_db(k) = 20.0*log10(amp1(k)/1);
    amp2_db(k) = 20.0*log10(amp2(k)/1);
end

[status, count] = viWrite(wavegen_id, "C1:OUTP OFF");
[status, count] = viWrite(wavegen_id, "C2:OUTP OFF");

viClose(wavegen_id);
viClose(scope_id);
viClose(defaultRM);

if ( swap == 0 ) then
    scf();
    plot2d("ln",freq_set/1000000,amp1_db,2);
    plot2d("ln",freq_set/1000000,amp2_db,5);
    xlabel("Frequency [MHz]");
    ylabel("Amplitude [db]");
    title("Frequency sweep");
    legend(["SDG2042X:CH1->DS1074Z:CH1 (Cable 1)";"SDG2042X:CH2->DS1074Z:CH2 (Cable 2)"],"in_lower_left");
    set(gca(),"grid",[1 1]);
elseif ( swap == 1 ) then
    scf();
    plot2d("ln",freq_set/1000000,amp2_db,2);
    plot2d("ln",freq_set/1000000,amp1_db,5);
    xlabel("Frequency [MHz]");
    ylabel("Amplitude [db]");
    title("Frequency sweep");
    legend(["SDG2042X:CH1->DS1074Z:CH2 (Cable 1)";"SDG2042X:CH2->DS1074Z:CH1 (Cable 2)"],"in_lower_left");
    set(gca(),"grid",[1 1]);
elseif ( swap == 2 ) then
    scf();
    plot2d("ln",freq_set/1000000,amp1_db,2);
    plot2d("ln",freq_set/1000000,amp2_db,5);
    xlabel("Frequency [MHz]");
    ylabel("Amplitude [db]");
    title("Frequency sweep");
    legend(["SDG2042X:CH2->DS1074Z:CH1 (Cable 1)";"SDG2042X:CH1->DS1074Z:CH2 (Cable 2)"],"in_lower_left");
    set(gca(),"grid",[1 1]);
end

--- End code ---
kim.dd:
Did the measurement again now with 50ohm termination at the scope terminals:



Both cables now perform the same... still similar bandwidth response.
Navigation
Message Index
There was an error while thanking
Thanking...

Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod