MATLAB: How to filter a signal with lowpass/highpass

filterlowpassr2019b

Hi all,
I am completely new in this field. Therefore, I need some help from the scratch.
According to a protocol, I have to filter a signal at 1.2 kHz ("the current derivative (of the signal) was addicionally filter at 1.2 kHz (sic)).
I've tried to filter the signal using the funtion lowpass:
y = lowpass(x,fpass,fs) %specifies that x has been sampled at a rate of fs hertz. fpass is the passband frequency of the filter in hertz)
x is my data, fpass is 1200 (1.2 kHz), but fs? I've checked the protocol and I've found this: "current signals were filtered at 2 kHz and digitized gap-free at 25 kHz."
So, what is the fs in my case? 2000, 25000, or 27000 (2000 + 25000)?
My main question is: how can I filter the signal at 1.2 kHz?
I've attached the data (Trial file). There are two variables (1×26 double), Time (s) and Intensity (pA). Plot it as (Time,Intensity).
Many thanks,
Jose

Best Answer

The easiest way to determine the sampling frequency is to measure it:
D = load('trial1.mat');
A = D.Intensity;
t = D.Time;
Ts = mean(diff(t)); % Sampling Interval
Fs = 1/Ts; % Sampling Frequency
The sampling frequency is 6250 (Hz, assuming ‘t’ is in seconds), and appears to have been sampled regularly (i.e. the sampling intervals are essentially identical). Define the passband of a filter so long as it is less than the Nyquist frequency, Fs/2, so a passband or stopband of 1.2kHz is possible.
I have no idea what ‘...current signals were filtered at 2 kHz and digitized gap-free at 25 kHz.’ means. You have to sort that.
Related Question