필터 지우기
필터 지우기

I am having problem in FFT function

조회 수: 3 (최근 30일)
Anmol Chauhan
Anmol Chauhan 2019년 10월 20일
답변: Sufiyan 2023년 4월 8일
How to calculate and plot the DFT of 11616026 like x=[1 1 6 1 6 0 2 6] using FFT function ? any idea? ?

답변 (1개)

Sufiyan
Sufiyan 2023년 4월 8일
Hi,
You can refer to the below code to find DFT of x= [1 1 6 1 6 0 2 6]
%input sequence x
x = [1 1 6 1 6 0 2 6];
% Calculate the DFT of x using the FFT function
X = fft(x);
N = length(x); % Length of x
f = (0:N-1)/N; % Frequency vector
figure
subplot(2,1,1)
stem(f, abs(X))
title('Magnitude spectrum')
xlabel('Frequency (cycles/sample)')
ylabel('Magnitude')
subplot(2,1,2)
stem(f, angle(X)*180/pi)
title('Phase spectrum')
xlabel('Frequency (cycles/sample)')
ylabel('Phase (degrees)')

카테고리

Help CenterFile Exchange에서 Discrete Fourier and Cosine Transforms에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by