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

Fix smoothing window function #86

Merged
merged 1 commit into from
Jan 13, 2016
Merged
Show file tree
Hide file tree
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
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