From: Edward Fisher on
Hello.
I have a few problems using Matlab low pass filters to demodulate a pulse density modulated signal.

My Matlab code generates a series of photon arrival times distributed by Poisson statistics and dependant on a time varying input. This gives me an output array that represents the time instance of photon arrivals. I then use the pulstran function to visualise these arrival times as a pulse density modulated signal. Interestingly the pulse train represents exactly what we get from our physical system.

I know that PDM data can be demodulated very easily using a low pass filter which I have implemented as a 10th order Butterworth low pass with a cut off of 1MHz.

Unfortunately because the pulse train uses the Dirac Delta to represent pulses my filtered output still shows the individual pulses and is not integrating the pulses as it should. Ironically its a function that works perfectly well in the physical system using an analogue RC low pass filter.

I have a funny feeling its because the pulse train is not an actual signal, unlike a sinusoid or standard square wave.

Any help would be much appreciated.
Thanks.
From: Edward Fisher on
Here is some example code that should be filtering a sawtooth wave with a low pass filter of 10Hz and a sample rate of 1kHz.

t = 0:1e-3:1;
d = 0:1/3:1;
y = pulstran(t,d,'tripuls',0.1,-1);
hold on
plot(t,y)

N = 10; %Filter order
Fp = 10; %(Hz)
Fs = 100*Fp; %Sample rate
plot_out = 0; %Do not plot filter out (uses fvtool)
LPD_coeff = LP_Dfilter(N, Fp, Fs, plot_out); %returns filter coefficients
FilteredSignal = filter(LPD_coeff, 1, y);
plot(t,FilteredSignal, 'red')
hold off

The above seems to do something to the input signal but with a low pass at 10Hz the sharp edge should be very very flattened and rounded.
Thanks.