Find value of frequency form Sin wav

僤鯓⒐⒋嵵緔 提交于 2019-12-11 22:17:33

问题


i have a this following equation of sine wav

Fs = 8000; % Sampling rate of signal
Fc = 3000; % Carrier frequency
t = [0:Fs-1]'/Fs; % Sampling times
dev = 50; % Frequency deviation in modulated signal

s1 = sin(2*pi*200*t)+2*sin(2*pi*f*t);

now i want to value of f for s1 equation how can we get this? thanks


回答1:


You may want to look around SO for similar questions.

The FFT is the simplest route to a solution:

spec = abs(fft(s1));

Then search for the maxima in the spectrum using a detection threshold.

Example (here f=10):

f= 10;
s1 = sin(2*pi*200*t)+2*sin(2*pi*f*t);

thresh = 0.2;
f1=abs(fft(s1))/sum(abs(s1));
f= [0:length(f1)-1]/length(f1)*Fs;
f(f1(1:end/2)>0.2)

This is the result (the frequencies in the spectrum for peaks with amplitude greater than the threshold value):

ans =

    10   200


来源:https://stackoverflow.com/questions/18672158/find-value-of-frequency-form-sin-wav

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!