Dominant frequency of a ramp function (Linear function)
조회 수: 14 (최근 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!