English 中文(简体)
• 如何控制MATLAB的轮胎产量的长度和取样时间?
原标题:How to control the length and sampling time of the output of ifft in MATLAB?

我在频率领域有这样的数据:

“entergraph

这意味着我有一个病媒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));
问题回答

If you know the sample rate and the duration, then it s easy to calculate the number of points, N:

N = duration (seconds) * sample_rate (Hz)

在频率领域,你需要同样数量的N点。 如果你更少,那么你只能用零打下。 每个双目在频率领域所代表的频率等于i / samples_rate,其中i为本数,0 <=i < N / 2

请注意,如果你想要在公平贸易论坛之后发出一个纯粹真实的时间域信号,那么你的频域数据就必须是复杂的对称。 如果你不关心这个阶段,那么就只能把对N/2和想象的零部分进行实际测量。

我将采取下列步骤,保持简单灵活:

  1. ifft
  2. Calculate the target sample rate divided by the starting sample rate.
  3. Get the upsample/downsample numbers that will get you the target sample rate by using the "rat" command.
  4. Resample the data using the "resample" command.
  5. If you only want a certain amount of data, just chop off some of it. If you need more data, pad your data with zeros before ifft ing it, as Paul suggested.

存在各种潜在的问题以及如何提高这种效率。 例如,你可以在频率领域进行取样。 不过,首先,我将保持简单易懂,学习你的道路。

如果你想要挖掘原病媒要素K,最终在N的病媒中以样本速度生产一种恶性毒素频率F:

(F * N)/(SR * K)

对于非排他性系数,使用一种反射的辛克族间推土机取得体面的成果。

零垫或继续推介(取决于您的干预方的宽度),以形成长效的N/2病媒。 如果污染产生高于N/2或低于0的双重重要价值,则具有双重价值,并加起来。

将实际病媒转化成复杂的病媒(“想象”元素,“偶然”类毒素结果为零)。

a. 反映N/2周围的长效矢量,以形成长度N的对应测量矢量,并按2.0的比值系数进行分辨;

选择性地,乘以一个比额表因素,即与贵贸总协定(1,N, sqrt(N)等中订立的比额表因素的反差。

FIFT().





相关问题
Least squares optimal scaling

I have two waveforms which are linked by a numerical factor. I need to use optimal scaling (least squares) between the two waveforms to calculate this factor in Matlab. Unfortunately I have no idea ...

How to Get a Quantitative Comparison of Two Signals

I’m trying to implement a Blind Source Separation (BSS) algorithm and I’m running into trouble determining the efficacy of the algorithm. I’m trying to create test cases where I work backwards and ...

数字过滤器设计

采用什么最佳方法选择马特拉布数字过滤器设计特性与全球数据分析仪的过滤器? 更具体地说,如果我有信号,我如何确定哪些过滤价值......。

DSP Algorithms Book [closed]

I m looking for a book similar to "Introduction to Algorithms" by Thomas Cormen geared towards DSP algorithms. Is there anything as thorough as Cormen on the DSP market? EDIT I should say I m ...

Digital Sound Processing in C# (and possibly SilverLight)

I need to do some basic and non basic DSP programming in C#. At its core, it includes the generation of a sin wave deciding its frequency in Hertz. Then I d like to Frequency Modulate it and maybe ...

Basic DSP - level adjustment

I m new to DSP programming, and I m wondering how best to carry out the seemingly basic operation of level adujustment. Say I have an 8 bit number that represents the amplitude I want a signal to be ...

Entertaining a baby with VB.NET

I would like to write a little application in VB.NET that will detect a baby s cry. How would I get started with such an application?

热门标签