I want to make a quantization of a complex signal in Python - need to have this signal as a set of discrete nonuniform levels. For example, a part of this signal can be represented as:
x = [0, 0.015, 0.03, 0.04, 0.08, 0.1, 0.11, 0.12, 0.14, 0.17, 0.2, 0.225, 0.24, 0.27, 0.31, 0.32, 0.33, 0.35, 0.36, 0.37, 0.39, 0.4, 0.42, 0.44, 0.45, 0.47, 0.48, 0.49, 0.5, 0.51, 0.52, 0.55, 0.57, 0.58, 0.6, 0.62, 0.64, 0.66, 0.68, 0.75, 0.77, 0.79, 0.82, 0.88]
y = [0, 0.5, 1, 1.5, 2, 2.5, 2.75, 2.93, 2.93, 2.8, 2.5, 2, 1.5, 1.15, 1, 0.95, 1, 1.08, 1.10, 1.07, 1.02, 0.9, 0.7, 0.3, 0.1, -0.4, -0.6, -0.65, -0.6, -0.3, 0, 0.35, 0.5, 0.9, 1.2, 1.25, 1.2, 1.1, 0.95, 0.7, 0.5, 0.3, 0, -0.15]
plot(x, y,"r"); grid(True); show()
Could you kindly recommend me how I can make it in Python?
This plot shows what I want to have: