Output
Source
{
int N = 400;
arma::vec b = "-0.2 -0.1 0.1 0.3 0.7";
arma::vec c = "-0.4 0.0 0.2 0.1 0.4";
int M = b.size();
arma::vec x(N, arma::fill::randn);
arma::vec y(N, arma::fill::zeros);
arma::vec d(N, arma::fill::zeros);
arma::vec z(N, arma::fill::randn);
arma::vec e(N, arma::fill::zeros);
arma::mat Wlog(M, N);
for (int n = 0; n < N; n++)
{
if (n == 200)
d(n) = G(x(n)) + 0.0001 * z(n);
}
for (int n = 0; n < N; n++)
{
y(n) = Ghat(x(n));
e(n) = d(n) - y(n);
}
cout << "Filter coeffs: " << c.t() << endl;
cout <<
"Estimated coeffs: " << Ghat.
get_coeffs().t() << endl;
gp0.
window(
"Plot", 10, 10, 500, 500);
gp1.
window(
"Plot2", 600, 10, 500, 500);
arma::vec J = 10 * log10(e % e);
return 0;
}