rcfilt

Filters a spectrum using an RC filter.

Syntax
yFilt = rcfilt(y,SampTime,TimeConst)
yFilt = rcfilt(y,SampTime,TimeConst,'up')
yFilt = rcfilt(y,SampTime,TimeConst,'down')
Description

rcfilt pipes the input signal y, usually an EPR spectrum, through a low-pass RC filter hard-wired into all cw EPR spectrometers. SampTime is the time used to obtain one point in the signal (usually called conversion time or sampling time), TimeConst gives the time constant of the RC filter. These two parameters must have the same time units (e.g. milliseconds).

rcfilt returns the filtered signal, which actually depends only on the ratio of SampTime and TimeConst. Be careful to assure that the first few points of the spectrum (usually baseline) are zero, otherwise an unwanted fade-in effect will appear.

The sweep direction of the field can be specified by an additional parameter, either 'up' or 'down'. If this is not specified, 'up' is assumed by default.

If y is a matrix, rcfilt operates on each column in turn.

If TimeConst is zero, no RC filtering is performed.

Examples

When recording CW EPR spectra, an RC filter is usually used to remove high frequency noise, thereby increasing the signal-to-noise ratio. Let's look at the effect of the RC filter on a noisy EPR spectrum. First we construct a mock EPR spectrum spec with noise.

field = linspace(340,350,1e3);
noise = 0.5*randn(size(field));
width = 1;
spec = gaussian(field,345,width,1) + noise;

Next we apply the RC filter and plot the result.

spec_smooth = rcfilt(spec,1,20);
plot(field,spec,'r',field,spec_smooth,'k')

Here we have used a time constant of 20 milliseconds for a conversion time of 1 millisecond. The noise level decreases significantly, and the signal centre shifts slightly to the right. If the field sweep is downwards, the centre shifts slightly to the left:

spec_smooth_d = rcfilt(spec,1,20,'down');
plot(field,spec,'r',field,spec_smooth_d,'k')
See also

datasmooth, gaussian, lorentzian, lshape, fieldmod, voigtian