How to use spectrum analyzer object to show a signal waveform ?

2 次查看(过去 30 天)
I am using the function SpectrumAnalyzer. How do I use it with a waveform?
Fs = 2500; Sineobject1 = dsp.SineWave('SamplesPerFrame',1024,'SampleRate',Fs,'Frequency',100); Sineobject2 = dsp.SineWave('SamplesPerFrame',1024,'SampleRate',Fs,'Frequency',1000); SA = dsp.SpectrumAnalyzer('SampleRate',Fs,'NumInputPorts',2,'PlotAsTwoSidedSpectrum',... false,'ChannelNames',{'SinewaveInput','NotchOutput'},'ShowLegend',true);

采纳的回答

Honglei Chen
Honglei Chen 2016-9-12
You can set FrequencyResolutionMethod to 'Window length' to manually adjust the length of signal used to compute the spectrum, e.g.,
Fs = 2500;
Sineobject1 = dsp.SineWave('SamplesPerFrame',1024,'SampleRate',Fs,'Frequency',100);
Sineobject2 = dsp.SineWave('SamplesPerFrame',1024,'SampleRate',Fs,'Frequency',1000);
SA = dsp.SpectrumAnalyzer('SampleRate',Fs,'NumInputPorts',2,'PlotAsTwoSidedSpectrum',...
false,'ChannelNames',{'SinewaveInput','NotchOutput'},'ShowLegend',true,...
'FrequencyResolutionMethod','WindowLength');
step(SA,step(Sineobject1),step(Sineobject2))

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Spectral Analysis 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by