Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I am using the following technique in writing data to AFG3021B Tektronix through Matlab0.2012a. Which is as you can see converting the waveform into a
I am using the following technique in writing data to AFG3021B Tektronix through Matlab0.2012a. Which is as you can see converting the waveform into a binary block and sending it to the output channel % Encode variable "waveform" into binary waveform data for AFG. This is the % same as AFG50006 but marker bits are ignored. Refer to AFG50006 series % programmer manual for bit definitions. binblock = zeros(2 = waveformLength, 1); binblock(2:2:end) = bitand(waveform, 255); binblock(1:2:end) = bitshift(waveform, -8); binblock = binblock'; % Build binary block header bytes = num2str(length(binblock)); header = ['#' num2str(length(bytes)) bytes]; % Transfer the custom waveform from MATLAB to edit memory of instrument furite(myFgen, [': TRACE EMEM, ' header binblock ";"], "units"); % Associate the waveform in edit memory to channel 1 fprintf(myFgen, "SOUR1:fUNC EMEM"); -- Since the previous code worked perfectly, i tried it with sending a modulate data (16QAM) to AFG which consists of two componants in phase and quadrature (complex) in other words I an trying to convert a complex array. But the problem is that the functions above "bitant" & "bitshift" does not accept parameters of type complex and they must be real. Is there another way of doing this? I am using the following technique in writing data to AFG3021B Tektronix through Matlab0.2012a. Which is as you can see converting the waveform into a binary block and sending it to the output channel % Encode variable "waveform" into binary waveform data for AFG. This is the % same as AFG50006 but marker bits are ignored. Refer to AFG50006 series % programmer manual for bit definitions. binblock = zeros(2 = waveformLength, 1); binblock(2:2:end) = bitand(waveform, 255); binblock(1:2:end) = bitshift(waveform, -8); binblock = binblock'; % Build binary block header bytes = num2str(length(binblock)); header = ['#' num2str(length(bytes)) bytes]; % Transfer the custom waveform from MATLAB to edit memory of instrument furite(myFgen, [': TRACE EMEM, ' header binblock ";"], "units"); % Associate the waveform in edit memory to channel 1 fprintf(myFgen, "SOUR1:fUNC EMEM"); -- Since the previous code worked perfectly, i tried it with sending a modulate data (16QAM) to AFG which consists of two componants in phase and quadrature (complex) in other words I an trying to convert a complex array. But the problem is that the functions above "bitant" & "bitshift" does not accept parameters of type complex and they must be real. Is there another way of doing this
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started