# Phase shift of transfer function

22 views (last 30 days)
Matija Milenovic on 1 Sep 2020
Answered: Swetha Polemoni on 4 Sep 2020
I'm trying to compute the phase shift of a transfer function (accelerance), but I'm having issues.
The transfer function was computed by dividing the magnitude of the system output by the input (please see here).
I've been using `pwelch()` to compute all of the functions in the frequency domain, but from the best of my understanding, the Welch PSD estimate outputs a real-valued vector, so there's no way to get a phase shift.
When I try to use the `fft()` function, the result (magnitude) doesn't look right, so I'm not sure if I would trust the phase shift. Below is the code I used to compute the transfer function:
% Welch Acceleration
[pa,f] = pwelch(ay,1000,10,0:10:10000,Fs);
% Welch Force
[pf,f] = pwelch(fy,1000,10,0:10:10000,Fs);
% Transfer function
H = pa./pf;
If someone could point me in the right direction it would be appreciated.

Swetha Polemoni on 4 Sep 2020
Hi,
As per my understanding, you want to calculate transfer function a system from its input and output. In general transfer function can be calculated by dividing output of the system in frequency domain by input/excitation given to system in frequency domain. Refer this for better understanding.
-> If only magnitude of input and output in frequency domain is used for calculating transfer function, all the system’s information cannot be understood. So if there is a phase shift between output and input , that is because of the system.
-> "pwelch()" is a power spectral density estimate. As the name suggests, it is always real since power is real . So, by dividing PSD of output with PSD of input may only give the magnitude information of the system.
Transfer function can also be estimated using "tfestimate()".

R2020a

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by