tags:

views:

57

answers:

1

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
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???
Use `fft` (or `spectrogram` if you have the signal processing toolbox) to convert to the frequency domain.
Jonas
Also, if you consider an answer useful, please consider accepting/upvoting it.
Jonas

related questions