def H(self): length = len(self.Y) ext_A = self.A * length ext_C = self.C * length count_N = 10 fir = FIR(count_N, ext_A, ext_C, self.Y) fir.batch_ufir() self.noise = fir.noise return fir.hmknoise
def FIR_Test(self, N=10, plot=False): fir = FIR(N, self.A, self.C, self.Y) length = len(self.Y) fir.batch_ufir() yest = [0 for i in range(N - 1)] + fir.y_est if plot: n = np.arange(0, length, 1) plt.ylabel("SignalAmplitude") plt.title("Ideal vs. Estimation (N = %d)" % N) p1, = plt.plot(n, self.Y_read) p2, = plt.plot(n, yest) plt.legend(handles=[p1, p2, ], labels=["Ideal", "Estimation"], loc="best") plt.savefig(r"E:\GIT\Filter\FIRFilter\test_plot\N = %d" % N, dpi=600) plt.show() return yest