Skip to content

Commit

Permalink
Merge pull request #86 from jaidevd/jd-fix-pwv
Browse files Browse the repository at this point in the history
Fix smoothing window function
  • Loading branch information
jaidevd committed Jan 13, 2016
2 parents ff36090 + 3614f47 commit 0876adb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
3 changes: 2 additions & 1 deletion tftb/processing/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ def _make_window(self):
h += 1 - np.remainder(h, 2)
from scipy import hamming
fwindow = hamming(int(h))
fwindow = fwindow / np.linalg.norm(fwindow)
# No need to normalize the window
# fwindow = fwindow / np.linalg.norm(fwindow)
return fwindow

def plot(self, ax=None, kind='cmap', show=True, default_annotation=True,
Expand Down
5 changes: 3 additions & 2 deletions tftb/processing/cohen.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,5 +258,6 @@ def smoothed_pseudo_wigner_ville(signal, timestamps=None, freq_bins=None,
from tftb.generators import fmlin
sig = fmlin(128, 0.1, 0.4)[0]
spec = PseudoWignerVilleDistribution(sig)
spec.run()
spec.plot()
tfr, _, _ = spec.run()
from scipy.io import savemat
savemat("/tmp/foo.mat", dict(tfr2=tfr))
2 changes: 0 additions & 2 deletions tftb/processing/tests/test_cohen.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
from tftb.processing import cohen
from tftb.generators import fmsin, fmlin
from tftb.tests.base import TestBase
from nose import SkipTest


class TestCohen(TestBase):
Expand Down Expand Up @@ -75,7 +74,6 @@ def test_wigner_ville_regionprops(self):

def test_pseudo_wv_energy(self):
"""Test the energy property of the pseudo WV representation."""
raise SkipTest("Known failure.")
signal, _ = fmsin(128)
signal = signal / 128.0
tfr, _, _ = cohen.PseudoWignerVilleDistribution(signal).run()
Expand Down

0 comments on commit 0876adb

Please sign in to comment.