Is there a way to set the color map and color limits of the dsp.SpectrumAnalyzer without using the spectrum properties GUI?
13 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
boatnoise
am 11 Jun. 2015
Kommentiert: Mary Malast
am 16 Mär. 2022
I have a piece of script that calls the dsp.SpectrumAnalyzer and uses it as a spectrogram. I would like to be able to hard code the color map and color limits into the script so that I don't have to go through the GUI in the spectrogram window to change these parameters each time it starts. Is there a property that can be set ahead of time that does this?
0 Kommentare
Akzeptierte Antwort
Aarti Ghatkesar
am 16 Jun. 2015
Hi
This cannot be done as there are no command line API's available to set the color properties for Spectrum Analyzer in DSP System Toolbox.
0 Kommentare
Weitere Antworten (1)
Kenny Barlee
am 12 Jan. 2016
There is actually an easy way to do this (posting as a note for people who find this page):
- make a spectrum analyzer object
- display data in it
- create figure handle to it
- set the colormap and color limits using figure handle
% create object
obj_spectrum = dsp.SpectrumAnalyzer(...)
% display data in it
step(obj_spectrum, data) % ('data' needs to come from somewhere)
% get figure handle
hfig = gcf
% set parameters
hfig.CurrentAxes.CLim = [-20 30] % for scale between -20dBm and 30dBm
hfig.Colormap = jet(256) % use jet/ hot/ cool/ grey etc
1 Kommentar
Siehe auch
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!