У нас вы можете посмотреть бесплатно Processus Aléatoires 7 - Filtrage adaptatif : Descente de gradient-Gradient stochastique (LMS) - RLS или скачать в максимальном доступном качестве, видео которое было загружено на ютуб. Для загрузки выберите вариант из формы ниже:
Если кнопки скачивания не
загрузились
НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если возникают проблемы со скачиванием видео, пожалуйста напишите в поддержку по адресу внизу
страницы.
Спасибо за использование сервиса ClipSaver.ru
Cours : • Processus Aléatoires 6 - Filtre de Wiener • Processus Aléatoires 4 - Filtrage optimal ... • Processus Aléatoires 1 - Moments statistiq... • Processus Aléatoires 2 - Stationnarité - B... Exercices précédents : • Exercices Processus Aléatoires 4 (Partie 1... • Exercices Processus Aléatoires 3 (Partie 1... • Exercices Processus Aléatoires 2 - Moments... • Exercices Processus Aléatoires 1 (Partie 1... Démo • Démo filtrage adaptatif par LMS (Gradient ... Code Python -*- coding: utf-8 -*- """ Created on Wed Nov 16 09:26:42 2022 @author: Akourgli import numpy as np import matplotlib.pyplot as plt import scipy.signal as sp; import scipy.linalg as la; import scipy.signal as sp; fecg=[]; mecg=[]; """ Lecture des fihiers """ with open('fecg.txt') as f: for i in f: fecg.append(float(i)) fecg = np.array(fecg) with open('mecg.txt') as f: for i in f : mecg.append(float(i)) mecg = np.array(mecg) """ Rajout du bruit """ N=len(mecg) var = 0.01; bb=(var**0.5)*np.random.randn(N); obs=fecg+mecg+bb; obs=obs-np.mean(obs); fecg=fecg-np.mean(fecg); y=fecg NN = 200; x=obs[0:NN]; y=fecg[0:NN]; Rxx_NN = np.correlate(x,x,mode='same')/NN; Ryx = np.correlate(fecg,obs,mode='same')/N; " Détermination du filtre adaptatif par Gradient stochastique déterministe" Ncoef=11; h = np.zeros(Ncoef) # Initialisation des coeffcients du filtre à 0 Rxx = la.toeplitz(Rxx_NN[0:Ncoef]); Ryx = Ryx[0:Ncoef] lamda_max = max(np.linalg.eigvals(Rxx)); #lamda_min = min(np.linalg.eigvals(Rxx)); mu=mu_opt = (2/(lamda_max+lamda_min)) pond=0.01; mu = (2/lamda_max)*pond Niter = 1000 En=np.empty(Niter) for i in range(Niter): h = h + mu*(Ryx-np.dot(Rxx, h)) hh = h/h[0]; yest = sp.lfilter(hh,1,obs) En[i] = sum(np.square(fecg-yest))/(2*N) plt.close('all') plt.figure(1) plt.plot(En,'g', label= 'Erreur Moyenne') plt.grid() plt.legend() "Filtrage" yfilt = sp.lfilter(hh,1,obs) yfilt = yfilt/abs(yfilt.max()) """Visualisation""" plt.figure(2) plt.subplot(311) plt.plot(obs,'r', label= 'Observation') plt.plot(fecg,'b', label= 'Signal original') plt.grid(); plt.legend() plt.subplot(312) plt.plot(obs/max(obs),'r', label= 'Observation') plt.plot(yfilt,'g', label= 'Signal filtré'); plt.legend() plt.subplot(313) plt.plot(fecg/max(fecg),'b', label= 'Signal original') plt.plot(yfilt,'g', label= 'Signal filtré') plt.grid(); plt.legend() " Détermination du filtre adaptatif par LMS : Gradient stochastique" mu=0.1; Ncoef=7; x=obs h = np.zeros(Ncoef) # Initialisation des coeffcients du filtre L = len(x) # Longueur du signal Y = [] # y(n) estimé En=np.empty(L) for i in range(Ncoef,L//10): X= x[i:i-Ncoef:-1] #Prendre X=[x(n),x(n-1),...,x(n-Ncoef+1)))] y_estim = np.dot(h, X) E_inst = x[i] - y_estim h = h + mu * E_inst * X Y.append(y_estim) En[i] = E_inst plt.close('all') plt.figure(1) plt.plot(En,'g', label= 'Erreur instantanée'); # plt.legend() "Filtrage" h=h/abs(sum(h)) yfilt = sp.lfilter(h,1,x) yfilt = yfilt/abs(yfilt.max()) plt.figure(2) plt.subplot(311) plt.plot(x,'r', label= 'Observation') plt.plot(y,'b', label= 'Signal original') plt.grid(); plt.legend() plt.subplot(312) plt.plot(x/max(x),'r', label= 'Observation') plt.plot(yfilt,'g', label= 'Signal filtré'); plt.legend() plt.subplot(313) plt.plot(y/max(y),'b', label= 'Signal original') plt.plot(yfilt,'g', label= 'Signal filtré') plt.grid(); plt.legend()