# Copyright (c) IMToolkit Development Team
# This toolkit is released under the MIT License, see LICENSE.txt
from .Channel import Channel
from .Util import xp, randn_c
[docs]class IdealOFDMChannel(Channel):
"""
A `Channel` class that generates the ideal OFDM channel coefficients. All the channel matrix is set to a diagonal matrix of `M` Rayleigh coefficients.
"""
def __init__(self, IT, M):
"""
Args:
IT (int): the number of parallel channel matrices.
M (int): the number of subcarriers.
"""
self.IT = IT
self.M = M
[docs] def randomize(self):
self.channelMatrix = (xp.tile(xp.eye(self.M), self.IT) * randn_c(self.IT * self.M)).T
[docs] def getChannel(self):
return self.channelMatrix
[docs] def getEstimate(self):
# Perfect channel state informaiton at the receiver
return self.channelMatrix