Filter Visualization Tool help

조회 수: 3 (최근 30일)
Ahmad Bilal
Ahmad Bilal 2018년 3월 28일
답변: Dheeraj 2024년 9월 4일
Hi, I have tried to execute the following code :
clc;
clear all;
n = 6; f = 0.8; a =fir1(n,f,'high'); %fir high pass filter b = fir1(n,f, 'low'); %fir low pass filter [y,fs] = audioread('pong.wav'); %load audio file
o = filter(a,1,y); %passing audio to designed high pass filter p = filter(b,1,o); %passing o to designed low pass filter
fvtool(p,1); %use to display designed filter
subplot(2,1,1); plot(y); %original signal y
subplot(2,1,2); plot(p); %filtered signal
But it shows following error:
Error using Filteraudiosignal (line 14) When first input is a matrix, it must have exactly 6 columns to be a valid SOS matrix.
Can anybody help me in this regard??

답변 (1개)

Dheeraj
Dheeraj 2024년 9월 4일
Hi Ahmad Bilal,
The error you're encountering occurs because the "filter" function expects the first input to be a filter coefficient vector or a matrix when working with second-order sections (SOS) in certain contexts. However, in your case, the input a and b are FIR filter coefficients, not an SOS matrix.

카테고리

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