Please do not use the acronym 'DFT' when you are using the 'FFT'
close all,clear all, clc, plt = 0;
N = 48
T = 3*pi
dt = T/N
t = dt*(0:N-1);
Fs = 1/dt
df = Fs/N
f = df*(0:N-1);
A =4
y = A * sin(f .* t);
plt=plt+1,figure(plt)
hold on
plot( t, y, 'LineWidth', 2)
plot( t, zeros(1,N), 'k--', 'LineWidth', 2 )
xlabel('Time (seconds)')
ylabel('y(t)')
title( 'SWEPT FREQUENCY TIME SIGNAL' )
Y = fftshift(fft(y))/N;
fb = f-Fs/2;
realY = real(Y);
imagY = imag(Y);
absY = abs(Y);
phaseY = angle(Y);
plt=plt+1,figure(plt)
subplot(2,2,1)
hold on
plot( fb, realY, 'LineWidth', 2 )
plot( fb, zeros(1,N), 'k--', 'LineWidth', 2 )
xlim( [ -Fs/2 Fs/2 ] )
ylabel( ' REAL(Y) ' )
title([ blanks(85) , ' SPECTRUM OF SWEPT FREQUENCY SIGNAL ' ] )
subplot(2,2,2)
hold on
plot( fb, imagY, 'LineWidth', 2 )
plot( fb, zeros(1,N), 'k--', 'LineWidth', 2 )
xlim( [ -Fs/2 Fs/2 ] )
ylabel( ' IMAG(Y) ' )
subplot(2,2,3)
hold on
plot( fb, absY, 'LineWidth', 2)
xlim( [ -Fs/2 Fs/2 ] )
ylabel( ' AMPLITUDE(Y) ' )
xlabel( ' FREQUENCY(HZ) ' ) ;
subplot(2,2,4)
hold on
plot(fb,phaseY, 'LineWidth', 2)
plot( fb, zeros(1,N), 'k--', 'LineWidth', 2 )
xlim( [ -Fs/2 Fs/2 ] )
ylabel( ' PHASE(Y) ' )
xlabel( ' FREQUENCY(HZ) ' ) ;
Hope this helps.
Thank you for formally accepting my answer.
Greg