0

let's say I have the following spectrogram:

Spectrogram of a 15 s signal

What I would like to do is blacken out areas that are above a certain energy level, eg.g, -110 dB - so all red, yellow and greenish parts. By blacken out I mean pull down to zero or -Inf in this case. I am tracking this border and I would like to see how well the tracking performs under certain conditions and this would help me visualize it. The result of this operation would be that everything close to 40 kHz would be black or dark blue and the remainder of the spectrogram would remain unchanged. Is there an easy way to do this without filtering? In general, is there an image processing function that lets you manipulate the energy values in whatever way you'd like? Thanks

schvaba986
  • 214
  • 1
  • 6
  • 5
    You can use spectrogram to return the plotted values instead of actually plotting them: [S,F,T,P] = spectrogram(...) , then use Yvon's method to remove values from the S matrix before plotting with the surf function. Check out the spectrogram help section and you should see what to do. – ewz Jul 21 '14 at 16:27
  • 1
    Setting `'CLim'` to `[anyMinimalValue,-110]`, then use a colormap `cm = jet(64); cm(1,:) = [0,0,0];`. No manipulation of data only of color axis. You can also modify the other 63 colors to make sure that it is easier to see. Of course, if you want to modify the data instead, then it is better to do something similar to @Yvon, or ewz – patrik Jul 22 '14 at 06:22
  • Cool, thanks. I only used the spectrogram for plotting, missed the return values part... Modifying the colors might even be better than changing the data since I just need it for visualization. – schvaba986 Jul 22 '14 at 08:47

0 Answers0