Hi Harshini,
I understand you want to write code for guard time variation with and without cyclic prefix in OFDM. Here's a general outline of how you can implement it:
1. Define the parameters of the OFDM system, including the number of subcarriers (N), guard time duration (Tg), symbol duration (Ts), and cyclic prefix length (Tc).
2. Generate the data symbols to be transmitted, represented as a complex-valued vector.
3. Apply the Inverse Fast Fourier Transform (IFFT) to the data symbols to obtain the time-domain OFDM symbol.
4. Incorporate the guard time into the OFDM symbol, taking into account the presence or absence of a cyclic prefix.
- In the absence of a cyclic prefix:
- Create a guard time vector of zeros with a length equal to Tg.
- Append the guard time vector to the OFDM symbol.
- With a cyclic prefix:
- Extract the cyclic prefix from the end of the OFDM symbol, with a length equal to Tc.
- Prepend the cyclic prefix to the beginning of the OFDM symbol.
5. If required, introduce any channel effects or impairments to the time-domain OFDM symbol, such as noise or fading.
6. Transmit the time-domain OFDM symbol over the channel.
7. At the receiver, capture the time-domain signal.
8. Remove the guard time from the received signal, depending on whether a cyclic prefix was used or not.
- In the absence of a cyclic prefix:
- Discard the initial Tg samples from the received signal.
- With a cyclic prefix:
- Eliminate the cyclic prefix by discarding the initial Tc samples from the received signal.
9. Apply the Fast Fourier Transform (FFT) to the received signal to obtain the frequency-domain OFDM symbol.
10. Demodulate the frequency-domain OFDM symbol to recover the transmitted data symbols.
Hope this helps you!