I am trying to demodulate a PPM signal in MATLAB. My signal is constructed using 2 base functions :
% Base function for bit 1 (centered around Tb/4 and has a width Tb/2) : g1 = @(t) Ag * rectpuls(t - (1/4)*Tb, Tb/2); % Base function for bit 0 (centered around 3/4*Tb, width Tb/2) : g0 = @(t) Ag * rectpuls(t - (3/4)*Tb, Tb/2); Which looks like this :
My signal is composed of many of these pulses according to a data vector. Everything is passed through a AWGN channel and then comes the demodulation part. Matched filters should be time reversed complex conjugate of my basis fonctions, which I created in my code like this :
% Matched filter for g0 h0 = @(t) conj(flip(g0(t))); % Matched filter for g1 h1 = @(t) conj(flip(g1(t))); I then convolve my signal with theses matched filters and compare the output to retrieve my original data vector.
% Matched filter outputs output_h0 = conv(r, h0(t), 'same'); output_h1 = conv(r, h1(t), 'same'); % Demodulate based on the maximum matched filter output rb = zeros(1, N); for k = 1:N % Decide which bit was transmitted based on the maximum output if output_h1(k * Fs) > output_h0(k * Fs) rb(k) = 1; else rb(k) = 0; end end My retrieved data looked wrong so I plotted the matched filters output and saw that it is completely wrong. What did I get wrong with matched filtering ?
Thanks for your help !



