Dominant frequency of a ramp function (Linear function)

8 ビュー (過去 30 日間)
Mukund Srivastava
Mukund Srivastava 2020 年 2 月 4 日
編集済み: Mukund Srivastava 2020 年 9 月 25 日
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 件)

カテゴリ

Help Center および File ExchangeFourier Analysis and Filtering についてさらに検索

製品


リリース

R2016a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by