我在频率领域有这样的数据:
这意味着我有一个病媒Y,包含病媒X中频率点的振幅。 例如
f = [0 1 2 3 4 5 6 7 8 9 10]
Y = [0 0 0 0 0 1 0 0 0 0 0]
进行反向的四舍五入式转变,应带来一波星级5Hz。
The MATLAB function ifft can transform Y and f to time domain. Lets call the vectors in time domain y and t. I m looking for a way how to get time domain data with a specified samplig frequency and a specified signal length. For example, I want time domain data with a signal length of 1 second and a sampling frequency of 1000Hz.
如果手工作业金字塔的输出量总是与投入的长度相同,那么我不敢确定为获取所需取样频率和信号长度提供什么投入。
To sum it up, I m trying to write a MATLAB function
[t,y] = custom_ifft(f,Y,sampling_frequency,signal_length)
将频率域数据(f,Y)转换成时域数据(t,y),在这种数据中,可在信号长度(例如1秒)中说明矢量长度,而取样频率(长度(y)/信号_length)可以用取样来说明。
EDIT: Please include in your answer the MATLAB code how to implement your idea. I already have the concept of how to do it, but I can t get the actual implementation to work. I m specifically asking what to give as input argument to the ifft function:
y = ifft(input_arg);
I m 期待着MATLAB代码在知道(f,Y,sampling_f频率,signal_length)时如何生成投入。
这里,我的执行并不像预期的那样发挥作用:
Y = [0 zeros(1,100) 1 0 0 zeros(1,500) 0 0 1 zeros(1,100)];
Y_interp = interp1(Y,linspace(1,length(Y),2*length(Y)));
y = ifft(Y) ;
y_interp = ifft(Y_interp);
figure;
plot(y);
figure;
plot(real(y_interp));
figure;
plot(abs(y_interp));