fir nyquist (l-凯发k8网页登录
this example shows how to design lowpass fir nyquist filters. it also compares these filters with raised cosine and square root raised cosine filters. these filters are widely used in pulse-shaping for digital transmission systems. they also find application in interpolation/decimation and filter banks.
magnitude response comparison
the plot shows the magnitude response of an equiripple nyquist filter and a raised cosine filter. both filters have an order of 60 and a rolloff-factor of 0.5. because the equiripple filter has an optimal equiripple stopband, it has a larger stopband attenuation for the same filter order and transition width. the raised-cosine filter is obtained by truncating the analytical impulse response and it is not optimal in any sense.
nband = 4; n = 60; % filter order r = 0.5; % rolloff factor tw = r/(nband/2); % transition bandwidth f1 = fdesign.nyquist(nband,'n,tw',n,tw); eq = design(f1,'equiripple',zerophase=true,systemobject=true); coeffs = rcosdesign(r,n/nband,nband,'normal'); coeffs = coeffs/max(abs(coeffs))/nband; rc = dsp.firfilter(numerator=coeffs); fvt = fvtool(eq,rc); legend(fvt,'equiripple nyquist design','raised cosine design');
in fact, in this example it is necessary to increase the order of the raised-cosine design to about 1400 in order to attain similar attenuation.
impulse response comparison
here we compare the impulse responses. notice that the impulse response in both cases is zero every 4th sample (except for the middle sample). nyquist filters are also known as l-th band filters, because the cutoff frequency is and the impulse response is zero every l-th sample. in this case, we have 4th band filters.
f1.filterorder = 38; eq1 = design(f1,'equiripple',zerophase=true,systemobject=true); coeffs = rcosdesign(r,f1.filterorder/nband,nband,'normal'); coeffs = coeffs/max(abs(coeffs))/nband; rc1 = dsp.firfilter(numerator=coeffs); fvt = fvtool(eq1,rc1,analysis='impulse'); legend(fvt,'equiripple nyquist','raised cosine');
nyquist filters with a sloped stopband
equiripple designs allow for control of the slope of the stopband of the filter. for example, the following designs have slopes of 0, 20, and 40 db/(rad/sample)of attenuation:
f1.filterorder = 52; f1.band = 8; f1.transitionwidth = .05; eq1 = design(f1,'equiripple', systemobject=true); eq2 = design(f1,'equiripple', stopbandshape='linear', stopbanddecay=20,systemobject=true); eq3 = design(f1,'equiripple', stopbandshape='linear', stopbanddecay=40,systemobject=true); fvt = fvtool(eq1,eq2,eq3); legend(fvt,'slope=0', 'slope=20', 'slope=40')
minimum-phase design
we can design a minimum-phase spectral factor of the overall nyquist filter (a square-root in the frequency domain). this spectral factor can be used in a similar manner to the square-root raised-cosine filter in matched filtering applications. a square-root of the filter is placed on the transmitter's end and the other square root is placed at the receiver's end.
f1.filterorder = 30; f1.band = nband; f1.transitionwidth = tw; eq1 = design(f1,'equiripple', minphase=true, systemobject=true); coeffs = rcosdesign(r,n/nband,nband); coeffs = coeffs / max(coeffs) * (-1/(pi*nband) * (pi*(r-1) - 4*r)); srrc = dsp.firfilter(numerator=coeffs); fvt = fvtool(eq1,srrc); legend(fvt,'minimum-phase equiripple design',... 'square-root raised-cosine design');
decreasing the rolloff factor
the response of the raised-cosine filter improves as the rolloff factor decreases (shown here for rolloff = 0.2). this is because of the narrow main lobe of the frequency response of a rectangular window that is used in the truncation of the impulse response.
f1.filterorder = n; f1.transitionwidth = .1; eq1 = design(f1,'equiripple', zerophase=true, systemobject=true); r = 0.2; coeffs = rcosdesign(r,n/nband,nband,'normal'); coeffs = coeffs/max(abs(coeffs))/nband; rc1 = dsp.firfilter(numerator=coeffs); fvt = fvtool(eq1,rc1); legend(fvt,'nyquist equiripple design','raised cosine design');
windowed-impulse-response nyquist design
nyquist filters can also be designed using the truncated-and-windowed impulse response method. this can be another alternative to the raised-cosine design. for example we can use the kaiser window method to design a filter that meets the initial specs:
f1.transitionwidth = tw;
kaiserfilt = design(f1, 'kaiserwin', systemobject=true);
the kaiser window design requires the same order (60) as the equiripple design to meet the specs. in contrast, we required an extraordinary 1400th-order raised-cosine filter to meet the stopband spec.
fvt = fvtool(eq,rc,kaiserfilt); legend(fvt,'equiripple design', 'raised cosine design', 'kaiser window design');
nyquist filters for interpolation
besides digital data transmission, nyquist filters are attractive for interpolation purposes. the reason is that every l samples you have a zero sample (except for the middle sample) as mentioned before. there are two advantages to this, both are obvious by looking at the polyphase representation.
fm = fdesign.interpolator(4,'nyquist'); kaiserfilt = design(fm,'kaiserwin',systemobject=true); fvt = fvtool(kaiserfilt); fvt.polyphaseview = 'on';
the polyphase subfilter #4 is an allpass filter, and in fact, it is a pure delay. to verify that, select impulse response or view the filter coefficients in fvtool. that pure delay branch of the polyphase filter has the following characteristics:
all of its coefficients are zero except for one, leading to an efficient implementation of that polyphase branch.
the interpolation filter preserves the input samples values, i.e. , even though the filter is not ideal.