using channels and getMeasurementsData in dsp.SpectrumAnalyzer
11 次查看(过去 30 天)
显示 更早的评论
Hello,
I have a dsp>spectrumAnalyzer object to which I have three traces. Display, Cursor measurments and manual trace selection works fine. Programatically I am having issues getting data for each trace (channel). I am attempting the following, however I only get channel one data in all calls.
scope.MeasurementChannel =1;
scope(tx_amp_out,tx_filt_out*tx_amp_gain_lin,tx_error);
data1 = getMeasurementsData(scope,'all');
scope.MeasurementChannel =3;
data3 = getMeasurementsData(scope,'all');
Please advise if there are additional details to get the respective channel measurements.
0 个评论
回答(1 个)
Meet
2024-11-15,5:20
编辑:Walter Roberson
2024-11-15,5:39
Hi Michael,
I encountered a similar issue. As a workaround, you can use the GUI for the Spectrum Analyzer to obtain measurements of those signals. Alternatively, you could create separate objects of "dsp.SpectrumAnalyzer" for each signal and then retrieve the measurement data from them.
For example, consider the code below, which analyzes two "SineWave" signals using separate "spectrumAnalyzer" objects.
Fs = 100e6; % Sample rate
fSz = 5000; % Frame size
sin1 = dsp.SineWave(1e0,5e6,0,SamplesPerFrame=fSz,SampleRate=Fs);
sin2 = dsp.SineWave(1e-1,15e6,0,SamplesPerFrame=fSz,SampleRate=Fs);
scope1 = dsp.SpectrumAnalyzer(SampleRate=Fs,AveragingMethod="exponential",RBWSource="auto",SpectrumUnits="dBW");
scope1.CursorMeasurements.Enable = true;
scope1.ChannelMeasurements.Enable = true;
scope1.PeakFinder.Enable = true;
scope1.DistortionMeasurements.Enable = true;
scope1(sin1())
data1 = getMeasurementsData(scope1);
disp(data1.DistortionMeasurements.Power);
scope2 = dsp.SpectrumAnalyzer(SampleRate=Fs,AveragingMethod="exponential",RBWSource="auto",SpectrumUnits="dBW");
scope2.CursorMeasurements.Enable = true;
scope2.ChannelMeasurements.Enable = true;
scope2.PeakFinder.Enable = true;
scope2.DistortionMeasurements.Enable = true;
scope2(sin2())
data2 = getMeasurementsData(scope2);
disp(data2.DistortionMeasurements.Power);
Note: Starting from MATLAB R2022a, support for "dsp.SpectrumAnalyzer" has ended. Therefore, it is recommended to use "spectrumAnalyzer" for MATLAB R2022a or later versions."
For more information, refer to the documentation link below:
Hope this helps!!
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spectral Analysis 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!