Question 1
$$ H(e^{j\omega})=\sum_{n=0}^{N-1}h[n]e^{-jn\omega} =\mathbf{c}^H(\omega)\cdot \mathbf{h} \tag{1} $$ $$ =\mathbf{h}^H\cdot\mathbf{c}(\omega) \tag{2} $$
$$H(\mathbf{h})=\sum_{k=1}^Kh[k]e^{j\omega_k}\tag{3}$$
The design of filter in matlab ,if using:
$-$$(1)$ and $(3)$ the length of filter is $K$.
$-$$(2)$ the length of filter is $N$.
- What is the difference between these two design?
- Can i use the operation 'transpose' in $D(w)$ and weighting function,length of filter?
Question 2
application in matlab
I used the same functions in 'cfirls' like desired and actual function.
%% Desired coefficient
N = 61; %desired filter length
tau = 26; % desired passband group delay
% frequency grid
f = [linspace(-1,-.18,164),linspace(-.1,.3,80),linspace(.38,1,124)];
% desired frequency response
d = [zeros(1,164),ones(1,80),zeros(1,124)].*exp(-1i*pi*f*tau);
w = [10*ones(1,164),ones(1,80),10*ones(1,124)];
A = w(:,ones(1,N)) .* exp(-1i*pi*f*(0:N-1));
h = A \ (w.*d);
%%actual function
c=[zeros(1,164),ones(1,80),zeros(1,124)]*exp(-1i*pi*f*(0:N-1));
H=h'.*c;
%% error function
E=abs(H-d)^2;
S=sum(E');
plot(f,S)
I need in my work to reduce the error as little as possible.How can i changing in this code?
E=abs(H-D)^2;
... where this variable D comes from? $\endgroup$D
different fromd
? You used
to design the filter and then you useD
to compute the error, this doesn't make much sense. $\endgroup$