[READ-ONLY] Mirror of https://github.com/jmrplens/MATLAB_Instruments. Laboratory instruments control with MATLAB
experiment instruments laboratory matlab
0

Configure Feed

Select the types of activity you want to include in your feed.

Update

Jose M. Requena Plens (Nov 4, 2021, 10:26 PM +0100) 7b95d8de 4addcef3

+50 -50
+50
TiePie Handyscope HS5/Example_TiePie_GenRec_Arbitrary.m
··· 1 + % Test TiePie 2 + clc, close all; 3 + 4 + %% Parameters 5 + 6 + % Signal parameters 7 + fs = 1e6; % Sample rate (Hz) 8 + f1 = 37e3; % Hz 9 + f2 = 43e3; % Hz 10 + T = 0.02; % s 11 + % Amplitude 12 + Amp = 2; % Volts pp 13 + % Repetitions 14 + Pulses = 1; 15 + 16 + % Acquisition parameters 17 + RecordLength = ceil((T+5e-3)*fs); % Samples 18 + VRange = [Amp,0.1*Amp]; % Volts 19 + ProbeGain = [1,3]; 20 + Channels = [1,2]; 21 + 22 + %% Import Assets 23 + addpath('TiePieLib') 24 + % Get library 25 + import LibTiePie.* 26 + LIB = get_TiePie_Library(); 27 + 28 + %% Signal generation 29 + import Others.* 30 + [data,~] = SweptSine(f1,f2,fs,T); 31 + 32 + %% Generation and reception 33 + [signal,t,real_fs] = TiePie_GENandREC_Arbitrary(LIB,data,fs,Channels,Amp,Pulses,RecordLength,VRange,ProbeGain); 34 + 35 + % Data 36 + dataCH1 = signal(:,1); 37 + dataCH2 = signal(:,2); 38 + 39 + % Plot 40 + yyaxis left 41 + plot(t,dataCH1); 42 + ylim([-VRange(1),VRange(1)]) 43 + xlabel('Time [s]'); 44 + ylabel('Amplitude channel 1 [V]'); 45 + yyaxis right 46 + plot(t,dataCH2); 47 + ylim([-VRange(2),VRange(2)]) 48 + legend('Channel 1','Channel 2') 49 + xlabel('Time [s]'); 50 + ylabel('Amplitude channel 2 [V]');
-50
TiePie Handyscope HS5/Test_TIEPIE.m
··· 1 - % Test TiePie 2 - clc, close all; 3 - 4 - %% Parameters 5 - 6 - % Signal parameters 7 - fs = 1e6; % Sample rate (Hz) 8 - f1 = 37e3; % Hz 9 - f2 = 43e3; % Hz 10 - T = 0.02; % s 11 - % Amplitude 12 - Amp = 2; % Volts pp 13 - % Repetitions 14 - Pulses = 1; 15 - 16 - % Acquisition parameters 17 - RecordLength = ceil((T+5e-3)*fs); % Samples 18 - VRange = [Amp,0.1*Amp]; % Volts 19 - ProbeGain = [1,3]; 20 - Channels = [1,2]; 21 - 22 - %% Import Assets 23 - addpath('TiePieLib') 24 - % Get library 25 - import LibTiePie.* 26 - LIB = get_TiePie_Library(); 27 - 28 - %% Signal generation 29 - import Others.* 30 - [data,~] = SweptSine(f1,f2,fs,T); 31 - 32 - %% Generation and reception 33 - [signal,t,real_fs] = TiePie_GENandREC_Arbitrary(LIB,data,fs,Channels,Amp,Pulses,RecordLength,VRange,ProbeGain); 34 - 35 - % Data 36 - dataCH1 = signal(:,1); 37 - dataCH2 = signal(:,2); 38 - 39 - % Plot 40 - yyaxis left 41 - plot(t,dataCH1); 42 - ylim([-VRange(1),VRange(1)]) 43 - xlabel('Time [s]'); 44 - ylabel('Amplitude channel 1 [V]'); 45 - yyaxis right 46 - plot(t,dataCH2); 47 - ylim([-VRange(2),VRange(2)]) 48 - legend('Channel 1','Channel 2') 49 - xlabel('Time [s]'); 50 - ylabel('Amplitude channel 2 [V]');