fftcoeffs

Frequency-domain coefficients

Syntax

c = fftcoeffs(hd)
c = fftcoeffs(ha)

Description

c = fftcoeffs(hd) return the frequency-domain coefficients used when filtering with the dfilt.fftfir object. c contains the coefficients

c = fftcoeffs(ha) return the frequency-domain coefficients used when filtering with adaptfilt objects.

fftcoeffs applies to the following adaptive filter algorithms:

Examples

This example demonstrates returning the FFT coefficients from the discrete-time filter hd.

b = [0.05 0.9 0.05];
len = 50;
hd = dfilt.fftfir(b,len);
c=fftcoeffs(hd);

Similarly, you can use fftcoeffs with the adaptive filters algorithms listed above. Start by constructing an adaptive filter ha.

d  = 16;                    % Number of samples of delay.
b  = exp(1j*pi/4)*[-0.7 1];  % Numerator coefficients of channel.
a  = [1 -0.7];              % Denominator coefficients of channel.
ntr= 1000;                  % Number of iterations.
s  = sign(randn(1,ntr+d)) +...
1j*sign(randn(1,ntr+d));     % Baseband QPSK signal.
n  = 0.1*(randn(1,ntr+d) + 1j*randn(1,ntr+d));  % Noise signal.
r  = filter(b,a,s)+n;       % Received signal.
x  = r(1+d:ntr+d);          % Input signal (received signal).
s  = s(1:ntr);              % Desired signal (delayed QPSK signal).
del = 1;                    % Initial FFT input powers.
mu  = 0.1;                  % Step size.
lam = 0.9;                  % Averaging factor.
blocksize   = 8;                    % Block size.
ha = adaptfilt.pbufdaf(32,mu,1,del,lam,blocksize);

Here are the coefficients before you filter a signal.

c=fftcoeffs(ha);
% all coefficients are zero
NumNonzero =nnz(c);

Filtering a signal y produces complex nonzero coefficients that you use fftcoeffs to see.

[y,e] = filter(ha,x,s);
c=fftcoeffs(ha);
Was this topic helpful?