Dominant frequency of a ramp function (Linear function)
8 次查看(过去 30 天)
显示 更早的评论
For a linear function y=mx where m is a constant, how to find the m such that the dominant frequency of the signal (y) attains a desired value? The code that I'm writing is yielding a dominant frequency at 0. How can I correct it?
Given the condition that y can reach a maximum value of 3, I need to define the rate of a linear signal y=mx such that the dominant frequency of the signal lies at 0.01.
I'm using the following code to perform this operation:
y=0.01:0.01:3; %Maximum value of 3 (fixed)
x=0.1:0.1:30; %Random values of x are given, and I'm trying to find the dominant frequency for this case.
% Based on the result for this x, I would've tweaked my 'x' values so as the dominant frequency reaches 0.01
y=abs(fft(y));
y=fftshift(y);
n=length(y);
f=(-n/2:n/2-1)*(2/n);
plot(f,y)
%Issue with the code is that it is yielding a dominant frequency at 0 for all the cases (random x values).
Further, I want to ask this question that is the dominant frequency for a linear function dependent on the rate at which the sample data are taken (sampling frequency)?
Thanks in advance!
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Fourier Analysis and Filtering 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!