Bug 115450 - More normalisation options for power spectrum
Summary: More normalisation options for power spectrum
Status: RESOLVED FIXED
Alias: None
Product: kst
Classification: Applications
Component: general (show other bugs)
Version: 1.x
Platform: Compiled Sources Linux
: HI wishlist
Target Milestone: ---
Assignee: kst
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-11-01 01:40 UTC by Andrew Walker
Modified: 2006-06-13 18:42 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Proposed patch (56.48 KB, patch)
2006-05-27 02:07 UTC, Andrew Walker
Details
Additional change for PSD units (20.53 KB, patch)
2006-05-27 02:18 UTC, Andrew Walker
Details
Additional patch (5.68 KB, patch)
2006-05-27 02:29 UTC, Andrew Walker
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Walker 2005-11-01 01:40:37 UTC
Version:           HEAD (using KDE KDE 3.4.0)
Installed from:    Compiled From Sources
OS:                Linux

Given the number of normalisation options for power spectra (or amplitude spectra) it would be desirable to provide more options when creating a power spectrum, otherwise it can be difficult to compare with other results.
Comment 1 Andrew Walker 2006-01-26 19:46:44 UTC
Should be fixed for 1.2.1 release
Comment 2 Andrew Walker 2006-03-23 22:22:50 UTC
The most common normalizations seem to be Leahy, Miyamoto and Schlittgen.
Comment 3 Andrew Walker 2006-03-26 05:33:46 UTC
> Marc-Antoine Miville-Deschenes:
> Could somebody tell me what is the "default" apodization function
> we use for PSDs in KST ?

The "default" apodisation does not appear to be a standard one (at least to me). Here is the code:

for (i = 0; i < len; i++) {
  _w[i] = (1 - cos(2*M_PI*double(i)/double(len)));
  sW += _w[i] * _w[i];
}
sW = sqrt(sW/double(len));
for (i = 0; i < len; i++) {
  _w[i] /= sW;
}
Comment 4 Andrew Walker 2006-05-02 18:16:53 UTC
The LFI team has requested support for the following:

Amplitude and power spectra: In units of amplitude (Volt), power (Volt^2), amplitude spectral density (Volt/rtHz) and power spectral density (Volt^2/rtHz).
Comment 5 Andrew Walker 2006-05-26 20:16:04 UTC
Proposal:

Add a combobox to the fftoptionswidget.ui so that the user can select between four options:

Power spectrum
Amplitude spectrum
Power spectral density
Amplitude spectral density

The default behaviour would be to produce the current output, and the setting would be "sticky" so the user can consistently produce the sampe type without the necessity of changing settings every time.
Comment 6 Andrew Walker 2006-05-27 02:07:20 UTC
Created attachment 16291 [details]
Proposed patch
Comment 7 Andrew Walker 2006-05-27 02:18:59 UTC
Created attachment 16292 [details]
Additional change for PSD units
Comment 8 Andrew Walker 2006-05-27 02:29:11 UTC
Created attachment 16293 [details]
Additional patch
Comment 9 George Staikos 2006-05-27 03:39:20 UTC
In general looks good, and it restores the window creation into the psd 
generator where it belongs.  Only thing I can see is that the function type 
should use an enum, not a magic number.
Comment 10 George Staikos 2006-05-29 19:17:32 UTC
SVN commit 546291 by staikos:

Apply Andrew's PSD patches so that I can continue work on PSDs without affecting
them.  Please add testcases and switch the function magic number to an enum
before closing the report.
CCBUG: 115450


 M  +2 -1      libkstapp/datawizard.ui.h  
 M  +14 -2     libkstapp/kstcsddialog_i.cpp  
 M  +1 -0      libkstapp/kstcsddialog_i.h  
 M  +13 -2     libkstapp/kstpsddialog_i.cpp  
 M  +1 -0      libkstapp/kstpsddialog_i.h  
 M  +1 -1      libkstapp/ksttoplevelview.h  
 M  +45 -12    libkstmath/kstcsd.cpp  
 M  +9 -6      libkstmath/kstcsd.h  
 M  +18 -10    libkstmath/kstobjectdefaults.cpp  
 M  +6 -3      libkstmath/kstobjectdefaults.h  
 M  +69 -139   libkstmath/kstpsd.cpp  
 M  +10 -6     libkstmath/kstpsd.h  
 M  +158 -9    libkstmath/kstpsdgenerator.cpp  
 M  +9 -2      libkstmath/kstpsdgenerator.h  
 M  +202 -149  widgets/fftoptionswidget.ui  
 M  +2 -0      widgets/fftoptionswidget.ui.h  
Comment 11 Andrew Walker 2006-06-01 00:50:47 UTC
SVN commit 547142 by arwalker:

CCBUG:115450 Use enum rather than int

 M  +1 -1      libkstapp/datawizard.ui.h  
 M  +2 -2      libkstapp/kstcsddialog_i.cpp  
 M  +2 -2      libkstapp/kstpsddialog_i.cpp  
 M  +7 -6      libkstmath/kstcsd.cpp  
 M  +6 -5      libkstmath/kstcsd.h  
 M  +8 -8      libkstmath/kstpsd.cpp  
 M  +7 -6      libkstmath/kstpsd.h  
 M  +7 -7      libkstmath/kstpsdgenerator.cpp  
 M  +14 -5     libkstmath/kstpsdgenerator.h  
Comment 12 Andrew Walker 2006-06-05 19:24:59 UTC
SVN commit 548490 by arwalker:

CCBUG:115450 Use enum for window function

 M  +2 -2      libkstapp/kstcsddialog_i.cpp  
 M  +10 -11    libkstmath/kstcsd.cpp  
 M  +9 -9      libkstmath/kstcsd.h  
 M  +23 -23    libkstmath/kstpsdgenerator.cpp  
 M  +21 -6     libkstmath/kstpsdgenerator.h  
 M  +1 -1      plugins/Makefile.am  
Comment 13 Andrew Walker 2006-06-13 18:42:52 UTC
Completed some time ago.