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

1 vue (au cours des 30 derniers jours)
Claudia
Claudia le 12 Sep 2016
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);

Réponse acceptée

Honglei Chen
Honglei Chen le 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))

Plus de réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by