1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
|
% --- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
% order of the filters
N = 5;
% cut-off normalized frequency
band = 0.5;
% ripple in the pass-band (dB)
Rpass = 0.5;
% ripple in the stop-band (dB)
Rstop = 20;
w = 0:pi/255:pi;
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Filtre de Butterworth
[num, den] = butter(N, band, 'low');
butterfilter = abs(freqz(num, den ,w));
% butterfilter(current_data);
% --- Executes on button press in pushbutton2.
function pushbutton2_Callback(hObject, eventdata, handles)
% order of the filters
N = 5;
% cut-off normalized frequency
band = 0.5;
% ripple in the pass-band (dB)
Rpass = 0.5;
% ripple in the stop-band (dB)
Rstop = 20;
w = 0:pi/255:pi;
% hObject handle to pushbutton2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Filtre de Chebychev1
[num, den] = cheby1(N, Rpass, band);
cheby1filter = abs(freqz(num, den ,w));
% plot(cheby1filter)
% --- Executes on button press in pushbutton3.
function pushbutton3_Callback(hObject, eventdata, handles)
% order of the filters
N = 10;
% cut-off normalized frequency
band = 0.5;
% ripple in the pass-band (dB)
Rpass = 0.5;
% ripple in the stop-band (dB)
Rstop = 20;
w = 0:pi/255:pi;
% hObject handle to pushbutton3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Filtre elliptique
[num, den] = ellip(N, Rpass, Rstop, band);
ellipfilter = abs(freqz(num, den ,w));
% plot(ellipfilter) |
Partager