Topshiriq o’lchovli signal sifatida har bir talaba o’zining ovozini yozib olib berilgan filtrlar bo’yicha filtrlaydi


Download 14.78 Kb.
Sana17.11.2023
Hajmi14.78 Kb.
#1782640
Bog'liq
1698914669 (1)


Topshiriq 2

1 o’lchovli signal sifatida har bir talaba o’zining ovozini yozib olib berilgan filtrlar bo’yicha filtrlaydi
2 o’lchovli signal sifatida har bir talaba Grayscale va RGB tasvirlar olib berilgan filtrlar bo’yicha filtrlaydi

LOWPASS filter
function y = doFilter(x)
%DOFILTER Filters input x and returns output y.

% MATLAB Code


% Generated by MATLAB(R) 9.14 and DSP System Toolbox 9.16.
% Generated on: 02-Nov-2023 10:39:33

persistent Hd;

if isempty(Hd)
Fpass = 0.35; % Passband Frequency
Fstop = 0.55; % Stopband Frequency
Apass = 1; % Passband Ripple (dB)
Astop = 15; % Stopband Attenuation (dB)
h = fdesign.lowpass('fp,fst,ap,ast', Fpass, Fstop, Apass, Astop);
Hd = design(h, 'equiripple', ...
'MinOrder', 'any', ...
'StopbandShape', 'flat');
set(Hd, 'Arithmetic', 'single');
set(Hd,'PersistentMemory',true);
end

y = filter(Hd,x);



HIGHPASS
function y = doFilter(x)
%DOFILTER Filters input x and returns output y.

% MATLAB Code


% Generated by MATLAB(R) 9.14 and DSP System Toolbox 9.16.
% Generated on: 02-Nov-2023 10:41:53

persistent Hd;

if isempty(Hd)
Fstop = 0.45; % Stopband Frequency
Fpass = 0.55; % Passband Frequency
Astop = 60; % Stopband Attenuation (dB)
Apass = 1; % Passband Ripple (dB)
h = fdesign.highpass('fst,fp,ast,ap', Fstop, Fpass, Astop, Apass);
Hd = design(h, 'equiripple', ...
'MinOrder', 'any', ...
'StopbandShape', 'flat');
set(Hd, 'Arithmetic', 'single');
set(Hd,'PersistentMemory',true);
end

y = filter(Hd,x);



Nyquist
function y = doFilter(x)
%DOFILTER Filters input x and returns output y.

% MATLAB Code


% Generated by MATLAB(R) 9.14 and DSP System Toolbox 9.16.
% Generated on: 02-Nov-2023 10:44:12

persistent Hd;

if isempty(Hd)
B = 2; % Number of Bands
TW = 0.1; % Transition Width
Astop = 80; % Stopband Attenuation (dB)
h = fdesign.nyquist(B, 'tw,ast', TW, Astop);
Hd = design(h, 'kaiserwin');
set(Hd, 'Arithmetic', 'single');
set(Hd,'PersistentMemory',true);
end

y = filter(Hd,x);



Image Filtering
https://www.mathworks.com/help/images/linear-filtering.html?s_tid=srchtitle_site_search_3_image%2520filtering
Download 14.78 Kb.

Do'stlaringiz bilan baham:




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling