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

1 Ansicht (letzte 30 Tage)
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);

Akzeptierte Antwort

Honglei Chen
Honglei Chen am 12 Sep. 2016
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))

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by