필터 지우기
필터 지우기

How to put specific frequency in a specific bin in frequency domain?

조회 수: 2 (최근 30일)
Qasim Mohammed
Qasim Mohammed 2020년 3월 13일
답변: Raunak Gupta 2020년 3월 16일
I have eight tones as represented by f, and I want to the distance between every two tones is different as shown in the figure,
I have the frequency spacing, but I need to put the tones properly, and I need the resolution and the number of samples to be suitable for FFT consideration.
N=8;
r=1;
f_d=1e3;
M=4;
m=0:M-1;
fc=2.45e9;
%% freq spacing
for j=1:M
f_spac(j)=(1+m(j)*r)*f_d; %freq spacing
end
%% Generate the frequency vector
for i=1:M
f(:,i)=[fc+((1+m(i)*r)/2)*f_d; fc-((1+m(i)*r)/2)*f_d];
end
B = reshape(f,[1,N]);
fs=20*f(N/2); % Sampling frequency
Ts=1/fs; % Sampling time
t=0:Ts:1e3*Ts; % Time vector

답변 (1개)

Raunak Gupta
Raunak Gupta 2020년 3월 16일
Hi,
I assume you have a time series vector which represents the signal. Taking fft of that will give the frequency response. Since in the above example code, the peak for each tone is clearly visible with no noise you may use findpeaks to find the local maxima. These will give corresponding frequency peaks. If the noise remains low the number of peaks will be equal to the number of tones present. This way by subtracting the successive peaks you can get the distance between each tone.

카테고리

Help CenterFile Exchange에서 Multirate Signal Processing에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by