Generate a square pulse
Mostrar comentarios más antiguos
create exactly one square pulse with the specified parameters. This square pulse should be stored in the array called one_square. The dimensions of this array should be 1 x N_sq_pos. The length of the square pulse you generate should be equal to N_sq_pos, i.e., the variable one_square should not change dimensions after you generate the pulse. Keep in mind that you have to set the energy of the square pulse to be equal to E_bit.
Inputs:
% t_axis: Time axis
% T_sq_dur: Duration of the square pulse in seconds
% E_bit: Total energy in all samples of one square pulse
% fs: Sampling frequency
% x_bits: Sequence of input bits (if not available, then it is equal
% to 1)
% type: Type of bit coding, 'RZ' or 'NRZ' (default is 'RZ')
% Outputs:
% x_square: The sequence of samples corresponding to the pulse shaping
% of the input bits using a square pulse shape
Output like this :

1 comentario
Ahmed Hassanen
el 3 de Nov. de 2021
Editada: Ahmed Hassanen
el 3 de Nov. de 2021
Respuestas (1)
AKennedy
el 12 de Jun. de 2024
0 votos
Generating the Pulse:
- Create a time axis "(t_axis)" from "0" to "T_sq_dur" with samples based on "fs".
- Calculate pulse amplitude (A) using "A = sqrt(E_bit / T_sq_dur)".
- Generate a binary sequence "(x_square)" with "x_bits" for the pulse duration (considering RZ transitions if applicable).
- Scale the sequence by A to get the final pulse with the required energy level.\
Array Dimensions:
The pulse ("one_square") should be a 1 x N_sq_pos array, where N_sq_pos is the number of samples based on "fs". This ensures the array maintains its size after generation.
By following these steps, you can create a square pulse and store it in the "one_square" array for further use.
Categorías
Más información sobre Mathematics en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!