Convert a digital filter to transfer function

Status
Not open for further replies.

Sandi2000

Junior Member level 2
Joined
Aug 3, 2018
Messages
21
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
178
I have a coefficients of FIR filter ,found it by 'fir1' function, in general, i want to convert a digital filter to transfer function with apply this formula :



The method :

Design a 48th-order FIR filter passband , with a cutoff frequency w=[0.35 0.65]. Compute the coefficients of the equivalent transfer function.

Code:
   % Coefficients of fir filter
   c = fir1(48,[0.35 0.65]);

   %Filter Transfer Function
    [b,a] = tf(c);

The error found:

Error using tf
Too many output arguments.

How can i solve this error ? how can i find a transfer function of fir filter with this specifications?
 

What do you mean by tool's name?can you give me an example ?
Your questions are issues of specific tool.
What tool do you use ?

Many people don't describe tool's name they use in this forum.
 
Last edited:

Your questions are issues of specific tool.
What tool do you use ?

Many people don't describe tool's name they use in this forum.

Do you mean signal processing toolbox?
 

It is Matlab code.

The wanted transfer function format is for a recursive (IIR) filter.
There is no division in the transfer function for a FIR filter.
You can approximate any filter transfer function with a FIR filter,
but it is difficult to convert an approximation back to the "original" function.
 
It is Matlab code.
So he uses signal processing toolbox and Control system toolbox in MATLAB.

Code:
>> c = fir1(48, [0.35 0.65]);

>> tf(c, 1, -1, 'Variable', 'z^-1')
 
Transfer function:
-0.002024 + 3.212e-018 z^-1 + 0.002246 z^-2 - 2.001e-018 z^             
                                                                        
        -3 - 6.37e-018 z^-4 - 7.613e-018 z^-5 - 0.006161 z^             
                                                                        
        -6 - 7.01e-018 z^-7 + 0.01176 z^-8 - 1.203e-017 z^-9            
                                                                        
        - 0.005932 z^-10 - 0.01689 z^-12 - 5.219e-018 z^-13             
                                                                        
        + 0.04207 z^-14 - 2.491e-017 z^-15 - 0.03612 z^-16              
                                                                        
        + 1.712e-017 z^-17 - 0.02845 z^-18 - 1.259e-017 z^-19           
                                                                        
        + 0.1424 z^-20 + 1.007e-017 z^-21 - 0.2542 z^-22 + 1.109e-016 z^
                                                                        
        -23 + 0.3008 z^-24 + 1.109e-016 z^-25 - 0.2542 z^-26            
                                                                        
        + 1.007e-017 z^-27 + 0.1424 z^-28 - 1.259e-017 z^-29            
                                                                        
        - 0.02845 z^-30 + 1.712e-017 z^-31 - 0.03612 z^-32              
                                                                        
        - 2.491e-017 z^-33 + 0.04207 z^-34 - 5.219e-018 z^-35           
                                                                        
        - 0.01689 z^-36 - 0.005932 z^-38 - 1.203e-017 z^-39             
                                                                        
        + 0.01176 z^-40 - 7.01e-018 z^-41 - 0.006161 z^-42              
                                                                        
        - 7.613e-018 z^-43 - 6.37e-018 z^-44 - 2.001e-018 z^-45         
                                                                        
                 + 0.002246 z^-46 + 3.212e-018 z^-47 - 0.002024 z^-48   
                                                                        
 
Sampling time: unspecified
>>
 
Last edited:
Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…