Skip to content

Commit

Permalink
Add impulse-highpass input signal
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiashienzsch committed Sep 12, 2024
1 parent 750d847 commit c504839
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/python/pffdtd/sim3d/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import h5py
import numpy as np
from numpy import pi,cos,sin
from scipy.signal import lfilter
from scipy.signal import butter,lfilter, sosfilt

from pffdtd.common.timerdict import TimerDict
from pffdtd.geometry.math import iceil
Expand Down Expand Up @@ -44,7 +44,7 @@ def __init__(self,save_folder):
self._diff = False

def print(self,fstring):
print(f'--COMMS: {fstring}')
print(f'--SIGNALS: {fstring}')

def prepare_source_pts(self,Sxyz):
in_alpha,in_ixyz = self.get_linear_interp_weights(Sxyz)
Expand All @@ -62,6 +62,10 @@ def prepare_source_signals(self,duration,sig_type='impulse'):

if sig_type=='impulse': #for RIRs
in_sig[0] = 1.0
if sig_type=='impulse-highpass': #for RIRs
in_sig[0] = 1.0
sos = butter(4, 40, 'highpass', fs=1/Ts, output='sos')
in_sig = sosfilt(sos, in_sig)
elif sig_type=='hann10': #for viz
N = 10
n = np.arange(N)
Expand Down

0 comments on commit c504839

Please sign in to comment.