说,我有一个模拟信号及其离散表示:
import numpy as np
import pylab as py
def sin(frequency = 1, time = 1, sampling = 128, phi = 0):
'''
Sinus function for a given frequency in Hz, length in time,
sampling frequency, and phase.
'''
dt = 1.0 / sampling
t = np.arange(0, time, dt)
s = np.sin((2 * np.pi * frequency * t) + phi)
return s, t
s_analog_1, t_analog_1 = sin(frequency = 1, sampling = 1000)
py.plot(t_analog_1, s_analog_1, linewidth = '1.5', color = 'red',
label = 'analog signal')
s_analog_2, t_analog_2 = sin(frequency = 1, sampling = 10)
py.plot(t_analog_2, s_analog_2, 'o', color = 'red')
# Calculate the quantization noise, ie "R/2^N"
s_discrete, t_discrete = sin(frequency = 1, sampling = 10)
N = 3
R = 2
dy = R/2**N
s_quantized = np.floor(s_discrete / dy) * dy + 0.5 *dy
py.plot(t_discrete, s_quantized, color = 'gray', label = 'discrete signal')
py.plot(t_discrete, s_quantized, 'o', color = 'gray')
py.legend(loc='upper right', fontsize='10')
py.show()
模数转换器是3位电平,它的测量范围是2.如何从离散信号表示中去除quntized噪声,使其适合模拟信号表示?当我已经收集离散信号时,在情境的背景下询问问题。在移除过程中,我可以使用量化噪声系数,即dy = R/2^N
。提前谢谢。