Problem with a high pass filter

조회 수: 3 (최근 30일)
Martin
Martin 2013년 12월 7일
댓글: Levi 2017년 4월 2일
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);

답변 (2개)

Wayne King
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);

Martin
Martin 2013년 12월 7일
편집: Martin 2013년 12월 7일
There is no error.. I just didn't know how to use this function to work my code. Now its okay. I try to filter a voice from song..
  댓글 수: 1
Levi
Levi 2017년 4월 2일
Could you please share how you did it pls. thank you :)

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Filter Design에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by