Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update slr.py #144

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions sigpy/mri/rf/slr.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def dzls(n=64, tb=4, d1=0.01, d2=0.01):
m = [1, 1, 0, 0]
w = [1, d1 / d2]

h = signal.firls(n + 1, f, m, w)
h = signal.firls(n + 1, f, m, weight=w)
# shift the filter half a sample to make it symmetric, like in MATLAB
c = np.exp(
1j
Expand Down Expand Up @@ -253,8 +253,8 @@ def dz_gslider_b(
m_sub = [1, 1, 0, 0, 0, 0]
w = [1, 1, d1 / d2]

b_notch = signal.firls(n + 1, f, m_notch, w) # the notched filter
b_sub = signal.firls(n + 1, f, m_sub, w) # the subslice filter
b_notch = signal.firls(n + 1, f, m_notch, weight=w) # the notched filter
b_sub = signal.firls(n + 1, f, m_sub, weight=w) # the subslice filter
# add them with the subslice phase
b = np.add(b_notch, np.multiply(np.exp(1j * phi), b_sub))
# shift the filter half a sample to make it symmetric,
Expand Down Expand Up @@ -344,15 +344,15 @@ def dz_gslider_b(
)
)

b_notch = signal.firls(n + 1, f, m_notch, w) # the notched filter
b_notch = signal.firls(n + 1, f, m_notch, weight=w) # the notched filter
b_notch = sp.ifft(
np.multiply(sp.fft(b_notch, center=False), c), center=False
)
b_notch = np.real(b_notch[:n])
# hilbert transform to suppress negative passband
b_notch = signal.hilbert(b_notch)

b_sub = signal.firls(n + 1, f, m_sub, w) # the sub-band filter
b_sub = signal.firls(n + 1, f, m_sub, weight=w) # the sub-band filter
b_sub = sp.ifft(
np.multiply(sp.fft(b_sub, center=False), c), center=False
)
Expand Down Expand Up @@ -460,8 +460,8 @@ def dz_hadamard_b(n=128, g=5, gind=1, tb=4, d1=0.01, d2=0.01, shift=32):
[np.arange(0, n / 2 + 1, 1), np.arange(-n / 2, 0, 1)]
)
)
bp = signal.firls(n + 1, f, mp, w) # the positive filter
bn = signal.firls(n + 1, f, mn, w) # the negative filter
bp = signal.firls(n + 1, f, mp, weight=w) # the positive filter
bn = signal.firls(n + 1, f, mn, weight=w) # the negative filter

# combine the filters and demodulate
b = sp.ifft(
Expand Down