MATLAB user defined inverse fourier transform

In summary, the conversation is about a program in MATLAB that calculates the time domain impulse response of a system from its continuous transfer function in the frequency domain. The program uses a sampling time and a matrix of omegas to perform the calculation. However, the program is not giving the expected result and the person is seeking help to identify the issue. The transfer function in question is a biquad filter and the solution may involve converting it to discrete form using the bilinear transform.
  • #1
manish_fra
1
0
Hi i am stuck with a program in MATLAB to find the time domain impulse response of a system from its continuous transfer function in the frequency domain.

Here is the program-
delt=1.5625e-9; %definition of delta t(sampling time).To be taken sufficiently small depending upon the time constant of the original signal.

delomg=1/(N*delt); % Kept sufficiently small to prevent repetition of curves in the plot due to aliasing .

komg=[-100*pi/(delt):delomg:100*pi/(delt)]; %matrix containing the omegas over which the summation is done.Should be sufficiently large to cover all the frequencies present the original signal.

s=sqrt(-1)*komg; %definition of s=jw


transfer_func_image= 1 -(s.*r1*(c1+c2) +1)./(s.^2.*r1.*r2.*c1.*c2 + s.*(r1*c1 + r2*c2+ r1*c2) +1);

h_image_dirac=zeros(1,N); %initialisation of the h_image matrix for better speed

for n=1:N % first sample at t=0
t=(n-1)*delt;
sumint_image = sum(transfer_func_image.*exp(s.*t).*delomg);
h_image_dirac(n)=(1./(2*pi)).*sumint_image;
end


This program defines a transfer function in terms of s.
The last part of the program starting from for n= 1:N , then integrates the transfer function by multiplying the transfer function vector with exp(j*omega*t) and summing the vector obtained after multiplying it with delomg.This duplicates the formula of laplace transform for the special case where the real part of s =0 and is thus effectively inverse Fourier transform.

The problem is the program is not giving the right result.If i find the value of the transfer function above at 2Meg, it is of the order of 10^-4
but if i use this program to obtain the impulse response and then convolve that with a sine wave at 2meg the answer is of the order of 100 and not 10^-4.

Where am i going wrong?This program works fine for another transfer function which i have tested.


please help.

thanks a lot.Please contact me if the problem is not clear.any help wud be appreciated.It is really important.
 
Physics news on Phys.org
  • #2
Your transfer function is a biquad filter. To get an impulse response, the transfer function has to be applied to an impulse. I'm not sure if I understand the question right, but you could convert the transfer function to discrete form (the Z-domain), and then get an impulse response. This is often done by using the "bilinear transform".
 

Related to MATLAB user defined inverse fourier transform

1. What is the purpose of a user-defined inverse Fourier transform in MATLAB?

The user-defined inverse Fourier transform in MATLAB allows users to reverse the process of a Fourier transform and convert a signal from the frequency domain back to the time domain. This is useful for analyzing and manipulating data that has been transformed into the frequency domain.

2. How do I define my own inverse Fourier transform function in MATLAB?

To define a user-defined inverse Fourier transform function in MATLAB, you can use the ifft function and specify the input signal and the number of points to use in the transform. You can also customize the function by specifying options such as the normalization factor and the direction of the transform.

3. What are the advantages of using a user-defined inverse Fourier transform in MATLAB?

One advantage of using a user-defined inverse Fourier transform in MATLAB is that it allows for more flexibility and customization in the analysis of frequency domain data. Users can specify the parameters and options that best suit their specific data and analysis needs.

4. Can I use a user-defined inverse Fourier transform for non-periodic signals?

Yes, a user-defined inverse Fourier transform can be used for non-periodic signals in MATLAB. However, it is important to note that the results may not be as accurate as when using a traditional Fourier transform, which is better suited for periodic signals.

5. Are there any limitations to using a user-defined inverse Fourier transform in MATLAB?

One limitation of using a user-defined inverse Fourier transform in MATLAB is that it may require more computational resources and time compared to using a traditional Fourier transform function. Additionally, the accuracy of the results may be affected by the quality and characteristics of the input data.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
1
Views
223
Replies
4
Views
421
  • Engineering and Comp Sci Homework Help
Replies
6
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
2
Views
1K
  • Differential Equations
Replies
4
Views
2K
  • Calculus and Beyond Homework Help
Replies
6
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
9
Views
3K
Replies
2
Views
2K
  • Calculus and Beyond Homework Help
Replies
1
Views
843
Back
Top