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 Center および File ExchangeFilter Design についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by