Skip to content

Commit

Permalink
fix noiseFilter
Browse files Browse the repository at this point in the history
  • Loading branch information
lockmatrix committed Nov 4, 2023
1 parent c1d9088 commit fbaa24b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/denoise.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,10 @@ def noiseFilter(self, Px, Pn, ak):
Hd = numpy.zeros(nSamples)
# iterating through the 'w' (from the paper)
for i in range(0, nSamples):
Hd[i] = pow((1 - self.c * Pn * ak / Px[i]), self.b)
if Px[i] == 0:
Hd[i] = 1
else:
Hd[i] = pow((1 - self.c * Pn * ak / Px[i]), self.b)
return Hd

def linearAk(self, nBands, slope):
Expand Down

0 comments on commit fbaa24b

Please sign in to comment.