how to apply a horizontal mean filter to a spectogram in matlab???
+1
A:
There are many ways. For example, you can use conv.
For a 1D spectrogram:
%# create some sample data
spectrogram = randn(1,1000); %# row vector of length 1000 with random values
%# define filter window
windowSize = 5; %# size of filter window
%# filter
filteredSpectrogram = conv(spectrogram,ones(1,windowSize)/windowSize,'same');
For a 2D spectrogram (and horizontal-only filter)
%# create some sample data
spectrogram = randn(100,1000); %# 100 rows, 1000 cols of random values
%# define filter window
windowSize = 5; %# size of filter window
%# filter
filteredSpectrogram = conv2(spectrogram,ones(1,windowSize)/windowSize,'same');
Jonas
2010-04-07 09:06:58
thanx a lot...this will be really helpful...one more qn though...i need to store certain sound samples in the form of a spectogram...how do i convert the sound wave into a spectogram???
2010-04-09 03:25:31
Use `fft` (or `spectrogram` if you have the signal processing toolbox) to convert to the frequency domain.
Jonas
2010-04-09 07:49:15
Also, if you consider an answer useful, please consider accepting/upvoting it.
Jonas
2010-04-09 07:49:42