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:(adsbygoogle = window.adsbygoogle || []).push({});

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 x^{2}(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 (Text):

%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 Forums - The Fusion of Science and Community**

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Solving linear systems using fourier transform

Can you offer guidance or do you also need help?

Draft saved
Draft deleted

Loading...

Similar Threads for Solving linear systems | Date |
---|---|

Mathematica Solve Perturbation problem with mathematica | Dec 7, 2017 |

MATLAB Solving equation with integration using MATLAB | Aug 4, 2017 |

Mathematica: Solving Linear Complex Systems | Nov 7, 2012 |

MATLAB Linear Algebra problem solved in MATLAB | Jul 3, 2012 |

Matlab: Solving linear system with QR/Householder | Sep 18, 2007 |

**Physics Forums - The Fusion of Science and Community**