help i like the new DSP Spectum but for the life of me can't get my tones of wavefoms to display
Info
This question is closed. Reopen it to edit or answer.
Show older comments
hi
Ok so I'm confused, I have looked into the examples but would like a simple Simulink that lets me select a *.mat file and a variable in it to be displayed on the spectrum analyzer...
Generally my files generated by different programs are complex (I/Q) data stored in .mat files..
I tried but this does not work, if 0 %//zap hsb = dsp.SpectrumAnalyzer; hsb.SampleRate = Fs; hsb.SpectralAverages = 1; hsb.PlotAsTwoSidedSpectrum = false; hsb.FrequencyResolutionMethod = 'RBW'; hsb.PowerUnits = 'dBm'; hsb.PlotMaxHoldTrace=true; contF = inputdlg('enter "p" For Power Spectrum','Input',1,{'p'}); if char(contF) == 'p' hsb.SpectrumType = 'power'; else hsb.SpectrumType = 'Spectrogram'; end %hsb.Position = [749 227 976 721]; show(hsb); fSz = 6000; % Frame size %wavB1_fs200a = real(CplxWaveIn)'; wavB1_fs200a = abs(CplxWaveIn)'; filename = [tempname '.mat']; % Create variable name save(filename,'wavB1_fs200a','-v7.3'); % Write to MAT file contFlag = 'c'; while contFlag == 'c' H = dsp.MatFileReader(filename,'VariableName','wavB1_fs200a','SamplesPerFrame', fSz); while ~isDone(H) % Stream data into MATLAB y1 = step(H); if max(y1) ~= 0 step(hsb,y1); end end end contFlag = input('enter "c" to loop again: ','s'); end
also this simulink it does not work;.
Answers (0)
This question is closed.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!