Solve MATLAB FFT Help for Unity Rectangular Pulse

  • Thread starter Thread starter Fronzbot
  • Start date Start date
  • Tags Tags
    Fft Matlab
Click For Summary
SUMMARY

The discussion focuses on finding the Fourier Transform of a unity amplitude rectangular pulse of width 2T using MATLAB. The user encountered discrepancies in the expected zero-crossing frequency, which should be ±π/T (approximately 3140), but MATLAB outputted around 2000. Additionally, the expected amplitude of 2*T (0.002) was incorrectly reported as 3. The provided MATLAB code generates the pulse and computes its FFT, but the user requires assistance in resolving these issues.

PREREQUISITES
  • Understanding of Fourier Transform concepts
  • Familiarity with MATLAB programming
  • Knowledge of rectangular pulse functions, specifically rectpuls
  • Experience with FFT (Fast Fourier Transform) in signal processing
NEXT STEPS
  • Review MATLAB's fft function documentation for proper usage
  • Investigate the effects of sampling frequency on FFT results
  • Learn about the fftshift function and its impact on frequency domain representation
  • Explore the implications of pulse width on Fourier Transform characteristics
USEFUL FOR

Students and professionals in signal processing, MATLAB users, and anyone studying Fourier Transforms and their applications in analyzing rectangular pulses.

Fronzbot
Messages
58
Reaction score
0

Homework Statement


Find the Fourier Transform of a unity amplitude rectangular pulse of width 2T, where T=[ims]. Use MATLAB to plot the magnitude response of this signal's FT.


Homework Equations





The Attempt at a Solution


I got something that LOOKS right, but the first zero-crossing SHOULD be +-pi/T which equals 3.14e3, in this case (since I'm taking the Fourier Transform of an aperiodic rectangular pulse). However, when plotted, MATLAB is telling me it's about 2000. On top of that, the amplitude should be 2*T which, in this case, is 0.002 but MATLAB says it's 3... I have no clue what is going wrong with the code. Any help would be GREATLY appreciated.

Code:
clear all
close all

% Part 1

%Following generates pulse of width T
T = 1e-3; %half-width of rectangular pulse
dt = 1e-3;
ts = [-T:dt:T];
pulse = rectpuls(ts);


%Generate fft of pulse
N = 1024; %Number of samples
y=fftshift(fft(pulse,N)); 
ws = 2*pi/T;
waxis = [-ws/2:ws/N:ws/2-(ws/N)];
plot(waxis,abs(y))
title(['FT of Rectangular Pulse of width ',num2str(2.*T./1e-3),'ms']);
xlabel('w [rad/s]');
ylabel('Amplitude');
axis auto
 
Physics news on Phys.org
anyone?
 

Similar threads

Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
Replies
2
Views
1K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 3 ·
Replies
3
Views
8K