根据测试获得的一组输入和一组输出计算频率响应
这是场景,
我有一组输入值,比如 2000,以及相应的输出值,采样率为 2000 个样本/秒,使用 50hz 的正弦波,那么我如何计算频率响应变量,
我在 matlab 中所做的是,
我调用所有输入值并对其进行快速傅立叶变换,
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
并在 90 度相位角处获取响应,这是正确的方法吗,
我可以根据我拥有的数据创建一个模型吗?做频率响应或者有其他方法来计算响应,我是 matlab 新手,需要帮助
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您的输入只是 50 Hz 的单个正弦曲线,那么您无法测量频率响应 - 您只能测量该特定频率下的增益和相移。采用 FFT 等不会告诉您有关频率响应的更多信息,尽管它可用于测量系统中的噪声和任何非线性的影响。
如果您想测量频率响应,那么您的输入信号需要是宽带的并覆盖感兴趣的频率范围,例如噪声、脉冲或扫频正弦波。
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.