Using Fdatool to design filter and use in MATLAB
This article describes the use of Fdatool design filter in MATLAB.
1. Type fdatool in MATLAB to run the filter Design and Analysis Tool. For specific use, see Signal processing toolbox->fdatool in MATLAB help.
2. Several issues to be noted in the Fdatool tool: (a) Fstop (band cutoff frequency) cannot be greater than or equal to the sampling frequency FS/2, which is determined by the way digital filter is designed. (b) The design of the filter is exported, there are two ways to export the filter either as filter coefficients variables or as a dfilt or mfilt filter Object Varia ble (See the signal processing toolbox->fdatool->exporting a Filter Design in MATLAB Help for more information.)
Export:
File---Export popup Export dialog box, select "Export as" as "Objects", "varable Names" can be changed, the default is HD.
3. (a) if the Dfilt or mfilt filter object variable is exported, you can convert the Dfilt filter object to a Transfer function form with [B, a] = TF (Hd) and then use D=filter (b,a,x); Filter. Where: filter is the default function, B, A is just designed transfer function parameters, X is the original acquisition signal, D is the filtered signal. X=importdata (' E:\matlab_work\xy\bb\O6.txt '); N=length (x); % take length fs=4000; % Sample frequency t= (0:n-1)/fs; Output Hd; [B,A]=TF (HD);% Get Transfer function d=filter (B,A,X); Subplot (311); Plot (t,x); Title (' original signal '); Xlabel (' t '); Ylabel (' Y '); Grid on;
Fdatool Design Filter and its use in "reprint" matlab