Spectrogram Image Filtering, Colorbar

This is a weird question but here goes. I have created a spectrogram using MATLAB's built in function. Basically I want to be able to filter the spectrogram to change the intensity levels. I also need this change to be reflected in the colorbar. For example, if I save the spectrogram as a jpeg and filter that image, the entire image is filtered including the axes, titles, and the colorbar. I want to be able to just filter the spectrogram and have the changes in the intensity be reflected in the colorbar. Any ideas? Should I save the figure as something else? Hopefully that makes sense.

2 Kommentare

PT
PT am 27 Mär. 2013
What do you mean filter? Give an example.
B
B am 27 Mär. 2013
I mean like a spatial filter such as the built-in average filter: fspecial('average'). I am basically trying to reduce noise by reducing the intensity of the spectrogram. I know this is very unconventional but I wanted to see if it was possible.

Melden Sie sich an, um zu kommentieren.

 Akzeptierte Antwort

Image Analyst
Image Analyst am 27 Mär. 2013

0 Stimmen

The color bar is a mapping of intensity to color. If you change the intensity, though noise reduction or filtering or any other method, then in the image it will take on the new color for that new intensity that it has. This will happen automatically (or as soon as you display the new intensity image with imshow() or imagesc()).
Use export_fig() to save. Find it in the File Exchange on the front page.

6 Kommentare

B
B am 27 Mär. 2013
This still blurs the axes though. I understand now that the colorbar will be updated but I need to have the axes to be unaffected. Maybe I'm just not using it correctly.
Image Analyst
Image Analyst am 27 Mär. 2013
I don't know why your data or image would have an axes in it unless you for some weird reason saved the whole axes or GUI as a screenshot with export_fig() or some (inferior) built-in MATLAB function. Can you upload a screen shot? Try snag.gy. Is it impossible for you to save the actual data with no other clutter like axes mixed up with it?
B
B am 27 Mär. 2013
I think that's my problem. I don't know how to save the image without the whole axes. The axes are included in the output of "spectrogram". How do I just save the image without axes?
Image Analyst
Image Analyst am 28 Mär. 2013
I don't know how you generated the image. What code did you use? What toolbox does it require?
B
B am 28 Mär. 2013
Here is my code that creates the data and the spectrogram. It only uses the signal processing toolbox.
t=0:0.1:13;
x=sin(2*pi*t);
noise=0.2*randn(size(t));
sig=x+noise;
tflog=specgram(sig,1000,128,32,31);
imagesc(abs(tflog));
yash patel
yash patel am 18 Sep. 2021
do you find any answer ..i have similar problem like you.....?

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Gefragt:

B
B
am 27 Mär. 2013

Kommentiert:

am 18 Sep. 2021

Community Treasure Hunt

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

Start Hunting!

Translated by