cli #15
|
|
@ -58,3 +58,6 @@ class Downsampling(Block):
|
||||||
:rtype: DataType
|
:rtype: DataType
|
||||||
"""
|
"""
|
||||||
return DataType.BASEBAND_SIGNAL
|
return DataType.BASEBAND_SIGNAL
|
||||||
|
|
||||||
|
def get_samples(self, num_samples):
|
||||||
|
raise NotImplementedError
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,9 @@ class Upsampling(Block):
|
||||||
"""
|
"""
|
||||||
return DataType.UPSAMPLED_SYMBOLS
|
return DataType.UPSAMPLED_SYMBOLS
|
||||||
|
|
||||||
|
def get_samples(self, num_samples):
|
||||||
|
raise NotImplementedError
|
||||||
|
|
||||||
def __call__(self, signal: np.ndarray) -> np.ndarray:
|
def __call__(self, signal: np.ndarray) -> np.ndarray:
|
||||||
"""Upsample the input signal by inserting zeros between samples.
|
"""Upsample the input signal by inserting zeros between samples.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -85,6 +85,7 @@ class RaisedCosineFilter(PulseShapingFilter):
|
||||||
"""
|
"""
|
||||||
t_symbol = self.upsampling_factor
|
t_symbol = self.upsampling_factor
|
||||||
beta = self.beta
|
beta = self.beta
|
||||||
|
with np.errstate(divide='ignore', invalid='ignore'):
|
||||||
f_val = (
|
f_val = (
|
||||||
1
|
1
|
||||||
/ t_symbol
|
/ t_symbol
|
||||||
|
|
|
||||||
|
|
@ -86,6 +86,7 @@ class RootRaisedCosineFilter(PulseShapingFilter):
|
||||||
alpha = 4 * beta * t / t_symbol
|
alpha = 4 * beta * t / t_symbol
|
||||||
|
|
||||||
t[t == 0] = 1e9
|
t[t == 0] = 1e9
|
||||||
|
with np.errstate(divide='ignore', invalid='ignore'):
|
||||||
f_val = (np.sin(np.pi * t / t_symbol * (1 - beta)) + alpha * np.cos(np.pi * t / t_symbol * (1 + beta))) / (
|
f_val = (np.sin(np.pi * t / t_symbol * (1 - beta)) + alpha * np.cos(np.pi * t / t_symbol * (1 + beta))) / (
|
||||||
np.pi * t * (1 - alpha**2)
|
np.pi * t * (1 - alpha**2)
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user