Respiration belt signal example: LPF filter

We illustrate the usage of butterworth LPF on respiration data in resp_noisy.txt.

ELEC-C5211 - Johdatus signaalien tilastolliseen mallintamiseen ja paattelyyn

Contents

Load the data

sampling frequency is

$$f_s = \frac{1}{T_s}$$

where $T_s$ is the sampling interval

Ts = 0.001; % sampling interval (in seconds)
fs = 1/Ts;  % sampling frequency (sampling at 1000 Hz )
respiration_n = load('resp_noisy.txt');

plot the noisy respiration belt signal

ind = 1:100:20000; % plot 20 seconds
figure(1); clf
plot(ind*Ts,respiration_n(ind),'b','linewidth',2.5)
xlabel('Time [s]');
set(gca,'LineWidth',2.0,'FontSize',18);
grid on; ylim([-3 3]);
set(gca,'YTick',-3:1:3,'FontSize',12,'FontSize',16)
set(gca,'XTick',0:2:20,'FontSize',12,'FontSize',16)
ax = axis;

Apply the (butterworth) LPF to the signal

fc = 2; % cut off frequency is 2 Hz
fc_n = fc/(fs/2); % normalized by the Nyquist rate
[b,a] = butter(4,fc_n,'low');
[H,f] = freqz(b,a,10000,fs); % The frequency response H for samling frequency 1000 Hz
ind = find(f < 10);

% Plot the gain (the amplitude of frequency response)
figure(2); clf
plot(f(ind),abs(H(ind)),'b-','LineWidth',2.5);
axis tight; axis on;
grid on;
xlim([0 10])
xlabel('Frequency $f$ [Hz]','Interpreter','Latex');
ylabel('$|H(\mathrm{exp}(j 2 \pi f/f_s))|$','Interpreter','Latex');
set(gca,'LineWidth',2.0,'FontSize',20);

Plot the filtered signal

respiration_f = filter(b,a,respiration_n); % filtered signal
ind = 1:100:20000;
figure(3); clf
plot(ind*Ts,respiration_f(ind),'b-','LineWidth',2.5)
xlabel('Time [s]');
set(gca,'YTick',-3:1:3,'FontSize',12,'FontSize',16)
set(gca,'XTick',0:2:20,'FontSize',12,'FontSize',16)
grid on; ylim([-3 3]);
set(gca,'LineWidth',2.0,'FontSize',18);

Question

Explain why LPF works so well in this case.