[PhasedArr​aySystemTo​olbox] How to apply spectrum window

2 views (last 30 days)
Hello! I'd like to understand how matched filter works. I can obtain truly result from the example, but without spectrum window:
hw = phased.LinearFMWaveform('PulseWidth',1e-4,'PRF',5e3);
x = step(hw);
hmf = phased.MatchedFilter(...
'Coefficients',getMatchedFilter(hw),...
'SpectrumWindow','None');
y = step(hmf,x);
r = getMatchedFilter(hw);
xft = fft(x);
rft = fft(r, 200);
my_y = ifft(rft .* xft);
x = 1:1:200;
plot(x, real(my_y), 'b', x, real(y), 'g');
where x - input signal, r - filter response and y and my_y - filtered signal.
I'd like to understand how should I apply spectrum window. According to the documentation I should do it that way:
hw = phased.LinearFMWaveform('PulseWidth',1e-4,'PRF',5e3);
x = step(hw);
hmf = phased.MatchedFilter(...
'Coefficients',getMatchedFilter(hw),...
'SpectrumWindow','None');
y = step(hmf,x);
r = getMatchedFilter(hw);
xft = fft(x);
rft = fft(r .* hamming(100), 200);
my_y = ifft(rft .* xft);
x = 1:1:200;
plot(x, real(my_y), 'b', x, real(y), 'g');
but signals are different:
What is wrong?

Answers (1)

Honglei Chen
Honglei Chen on 6 Apr 2015
According to your code, you are comparing the signal you manually applied windowing with the result of matched filter when no windowing is applied. So your comparison is not apple to apple.
This being said, there are several things you need to consider when you try to apply spectrum windowing
1. The band over which you want to apply the windowing for. The signal may be significantly oversampled but you only want to apply the window to the bandwidth you care. If you simply apply the window to the entire length after FFT, that corresponds to the case where you want to apply the window to entire bands in the signal.
2. The phased.MathcedFilter also perform overlap and add internally so if you break the signal into chunks and pass them through one by one, you get the identical result as if you passed the entire data in. The code you used above did not consider that effect.
HTH

Community Treasure Hunt

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

Start Hunting!