Spectrum Analyzer Input Channels

6 次查看(过去 30 天)
I have a task in which I need to do spectral analysis on a given signal utilizing "dsp.SpectralAnalyzer()". However whenever I try to do this I face the error message: "The number of input channels cannot exceed 100.". Which is as far as I understood a problem regarding the validation of the data to be analyzed in terms of number of channels. However, I haven't found much information on the dsp.SpectralAnalyzer help page regarding the input channels. Thus I don't know what values to change to get it to work. I tried shortening the "time vector" I created in my code and I succeded on getting the Spectrum Analyzer to appear. However this time I couldn't get it to work as it indicated that I didn't have enough samples. I believe my sample number is above what is requested but it my task indicates that I cannot change anything related to sampling. I don't know how I can get the analyzer to work by coming around this issue.
Thanks.
clc;
clear;
% command window cleanup
fm1 = 5;
fm2 = 10;
Amessage = 2;
% Definition for signal generation
fSampling = 200;
tSample = 5*10^-3;
fCarrier = 40;
% Definitions for de/modulation process
tMessage = 0:tSample:50;
% Time vector creation to generate signals with pre-determined slicing.
m1 = Amessage * sin(2*pi*fm1*tMessage);
m2 = Amessage * sin(2*pi*fm2*tMessage);
m = m1 + m2;
% Signal Generation
% sDBS = amDSBSC(m, fCarrier, fSampling);
% sL = amSSB(m, fCarrier, fSampling, 'lower');
% sU = amSSB(m, fCarrier, fSampling, "upper");
% % Modulation
scope = dsp.SpectrumAnalyzer();
scope(m);
% Spectral Analysis,
I commented out a section as it contains functions I wrote as it wouldn't work here. But the general problem is the same. Even if I try to analyze the signals that I create, I can't do so.

采纳的回答

Ashutosh Singh Baghel
Hi Nizamettin,
I understand that you wish to analyze signal 'm' using 'dsp.SpectrumAnalyzer()'. The input to the spectrum analyzer must be a column vector and not a row vector. The different values in a row vector represent different channels, and column vector values correspond to the signal values.
scope(m');
A simple transpose would solve this problem.
One more method to analyze the signal could be done using pspectrum as follows.
% Parameters
frequencyLimits = [0 1]*pi; % Normalized frequency (rad/sample)
timeLimits = [1 10001]; % number of samples
m_1 = m(:);
m_1 = m_1(timeLimits(1):timeLimits(2));
% Compute spectral estimate
% Run the function call below without output arguments to plot the results
[pxx, f] = pspectrum(m_1, 'FrequencyLimits',frequencyLimits);
plot(f/pi,10*log10(pxx));
Refer to the following MATLAB Documentation page for further information.

更多回答(0 个)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by