tags:

views:

17

answers:

1

Hai, here is the scenario, i have a set of input values say 2000, and the corresponding out put values, the sampling rate was 2000 samples/sec, and a sinusoidal wave of 50hz was used, so how do I calculate the frequency response from this varaiables, what i did in matlab was, i called all the input values and took the fft of it, o=data(input), n=length(o);fs=2000 %sampliing frequency; y=fft(o,n), phase=angle(y), Pha=180*phase/pi(); m=length(y); f=(0:m-1)*fs/m; semilogx(f,Pha), grid on and the response was taken at 90 degree phase angle, is this the right way,

could i create a model from the datas i have and do the frequency response or is there any other way to calculate the response, i am new to matlab and need help

A: 

If your input was just a single sinusoid at 50 Hz then you can not measure the frequency response - all you can measure is the gain and phase shift at that one specific frequency. Taking FFTs etc will not tell you anything more about the frequency response, although it can be used to measure the noise and the effect of any non-linearities in your system.

If you want to measure frequency response then your input signal needs to be broad band and cover the frequency range of interest, e.g. noise, an impulse, or a swept sinusoid.

Paul R
thanks paul, so if my input is a sweep sinusoid,the input is current in milli amps and output is pressure, from the frequency analyser i have all the milli amps applied for a time period of 16 seconds,and all the corresponding output pressure, could i calcualte the freouency response between the output and the input
Jerry
@Jerry: you've got two completely separate problems here: (1) how to measure frequency response and (2) how to get the units right. (1) is the hard part, (2) is just a scaling factor which you may need to apply to get the correct values in your spectrum. Forget about (2) for now and just concentrate on getting a frequency response. Once you have that you can work out what the scaling factor needs to be to get the correct units.
Paul R