Dominant frequency of a ramp function (Linear function)

8 Ansichten (letzte 30 Tage)
Mukund Srivastava
Mukund Srivastava am 4 Feb. 2020
Bearbeitet: Mukund Srivastava am 25 Sep. 2020
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!

Antworten (0)

Kategorien

Mehr zu Fourier Analysis and Filtering finden Sie in Help Center und File Exchange

Produkte


Version

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by