Problem with a high pass filter
조회 수: 3 (최근 30일)
이전 댓글 표시
I would like to make a high pass filter so I have used fdatool for set up of it, which generated a function Hd, then I have imported everything to my source code but it doesn't work yet. I don't know why and can't to find and solve that problem.
function Hd = horni_propust_01
%HORNI_PROPUST_01 Returns a discrete-time filter object.
% MATLAB Code
% Generated by MATLAB(R) 8.2 and the Signal Processing Toolbox 6.20.
% Generated on: 07-Dec-2013 15:04:37
% Elliptic Highpass filter designed using FDESIGN.HIGHPASS.
% All frequency values are in Hz.
Fs = 48000; % Sampling Frequency
N = 10; % Order
Fpass = 1000; % Passband Frequency
Apass = 1; % Passband Ripple (dB)
Astop = 80; % Stopband Attenuation (dB)
% Construct an FDESIGN object and call its ELLIP method.
h = fdesign.highpass('N,Fp,Ast,Ap', N, Fpass, Astop, Apass, Fs);
Hd = design(h, 'ellip');
% [EOF]
[y,Fs,nBits]=wavread('def.wav');
left=y(:,1); % Left channel
right=y(:,2); % Right channel
hd = horni_propust_01;
fr = filter(hd,right);
zvuk = left - fr;
player = audioplayer(zvuk,Fs,nBits);
play(player);
댓글 수: 0
답변 (2개)
Wayne King
2013년 12월 7일
편집: Wayne King
2013년 12월 7일
Please specify what you mean by "...I have imported everything to my source code but it doesn't work yet"
What error message are you seeing?
You should just be able to execute the following in the workspace to filter one channel of your .wav file.
Fs = 48000; % Sampling Frequency
N = 10; % Order
Fpass = 1000; % Passband Frequency
Apass = 1; % Passband Ripple (dB)
Astop = 80; % Stopband Attenuation (dB)
h = fdesign.highpass('N,Fp,Ast,Ap', N, Fpass, Astop, Apass, Fs);
Hd = design(h, 'ellip');
[y,Fs,nBits]=wavread('def.wav');
left=y(:,1); % Left channel
right=y(:,2); % Right channel
fr = filter(Hd,right);
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Filter Design에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!