Last active
October 12, 2017 17:13
-
-
Save edy555/9677574 to your computer and use it in GitHub Desktop.
simulating CIC filter and modified one in python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import numpy as np | |
from pylab import * | |
x = np.random.randn(65536) | |
m=16 | |
d0 = [0] * m | |
d1 = [0] * m | |
d2 = [0] * m | |
y = [] | |
s0 = 0 | |
s1 = 0 | |
s2 = 0 | |
x.shape = (len(x)/2,2) | |
for xi in x: | |
s0 += xi[0]+xi[1] | |
s1 += s0 | |
s2 += s1 | |
d0.append(s2) | |
d1.append(d0.pop(0) - d0[-1]) | |
d2.append(d1.pop(0) - d1[-1]) | |
y.append(d2.pop(0) - d2[-1]) | |
psd(y) | |
show() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import numpy as np | |
from pylab import * | |
x = np.random.randn(65536) | |
m=16 | |
d0 = [0] * m | |
d1 = [0] * m | |
d2 = [0] * m | |
y = [] | |
s0 = 0 | |
s1 = 0 | |
s2 = 0 | |
for xi in x: | |
s0 += xi | |
s1 += s0 | |
s2 += s1 | |
d0.append(s2) | |
d1.append(d0.pop(0) - d0[-1]) | |
d2.append(d1.pop(0) - d1[-1]) | |
y.append(d2.pop(0) - d2[-1]) | |
psd(y) | |
show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
CIC
modified CIC