Solving linear systems using fourier transform

In summary, the conversation discusses using Matlab and Fourier transforms to solve linear systems. The transfer function is found by taking the Fourier transform of both sides and rearranging, and the final system is implemented in Matlab. There are some issues with getting the scaling right and the code only seems to work correctly for certain input functions.
  • #1
jjphys
1
0
I want to use Matlab and Fourier transforms to solve linear systems and am attempting to implement a very simple linear system (with the idea of implimenting a much more complex one later) that I can't seem to get working. The system will take the derivative with respect to time of the input as follows:

output(t) = (d/dt)*input(t)

Find the transfer function by taking the Fourier transform of both sides and rearranging (F = Fourier transform):

F[ output(t) ] = F[ (dinput/dt ]

F[ (dinput/dt ] = 2*pi*i*f * F[ input(t) ]

therefore:

F[ output(t) ] = 2*pi*i*f * F[ input(t) ]

and our transfer function, F[output(t)] / F[input(t)] = 2*pi*i*f = H(f)

The final system is:

output(t) = F-1[ 2*pi*i*f * F[ input(t) ] ]

The code that I'm implementing in Matlab is posted below seems to work correctly if the input function is sin or cos, but for x2 (which should yield 2x as the output) doesn't work (also note that I'm having some issues with getting scaling right, but I'm not to worried about this at the moment) Any ideas?

Code:
%parameters
L_duration_s=1.0;       %sampling duration, L
N_time_bins=1024;     % # samples
delta_t=L_duration_s/N_time_bins;
time_s=0:delta_t:(N_time_bins-1)*delta_t;
delta_f=1/L_duration_s;
f_ny=(N_time_bins/2)*delta_f;
time_f=-f_ny+(N_time_bins-1)*delta_f:-delta_f:-f_ny;

i_=sqrt(-1);

%pinput waveform
x_t=cos(2*pi*time_s);    %sin->cos
                            %cos->-sin

%fourier transform of input
x_f=(1/N_time_bins)*fft(x_t);

%xfer function
H_f=(1/N_time_bins)*((2*i_*pi).*time_f);
H_t=ifft(H_f);

%calculation of output
y_f=H_f.*x_f; 
y_t=N_time_bins* ifft(y_f);
 
Physics news on Phys.org
  • #2
%plotting resultssubplot(2,1,1);plot(time_s,x_t);xlabel('Time ');ylabel('Amplitude [V]');title('Input Waveform');subplot(2,1,2);plot(time_s,y_t);xlabel('Time ');ylabel('Amplitude [V]');title('Output Waveform');
 

What is a Fourier transform and how is it used to solve linear systems?

A Fourier transform is a mathematical tool that decomposes a function into its frequency components. It is used to solve linear systems by transforming the system of equations into a new domain, the frequency domain, where complex numbers are used to represent the equations. This allows for easier manipulation and solution of the system.

What are the advantages of using a Fourier transform to solve linear systems?

Using a Fourier transform to solve linear systems has several advantages. It allows for the use of complex numbers, which can simplify the equations and make them easier to solve. It also allows for solving systems with varying frequencies, which may be difficult to solve using traditional methods.

What are the limitations of using a Fourier transform to solve linear systems?

One limitation of using a Fourier transform to solve linear systems is that it can only be applied to linear systems. Nonlinear systems cannot be solved using this method. Additionally, the Fourier transform may not always yield a unique solution, as there may be multiple solutions that satisfy the transformed equations.

What are some real-world applications of solving linear systems using Fourier transform?

Solving linear systems using Fourier transform has many practical applications. It is commonly used in signal processing, such as in audio and image compression. It is also used in control theory for analyzing and designing systems, and in solving differential equations in physics and engineering.

What are some alternative methods for solving linear systems besides using Fourier transform?

There are several alternative methods for solving linear systems, such as Gaussian elimination, Cramer's rule, and matrix inversion. These methods may be more suitable for certain types of systems or may have different limitations. It is important to understand different methods and choose the most appropriate one for a given problem.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
8
Views
1K
Replies
4
Views
276
  • Calculus and Beyond Homework Help
Replies
6
Views
2K
  • Differential Equations
Replies
4
Views
2K
  • Topology and Analysis
Replies
7
Views
2K
  • Calculus and Beyond Homework Help
Replies
1
Views
776
  • Calculus and Beyond Homework Help
Replies
5
Views
327
  • MATLAB, Maple, Mathematica, LaTeX
Replies
7
Views
2K
Back
Top