Bug 164466 - The Peak of the Kst Amplitude Spectrum is lower than the Amplitude Spectrum in Octave
Summary: The Peak of the Kst Amplitude Spectrum is lower than the Amplitude Spectrum i...
Status: RESOLVED NOT A BUG
Alias: None
Product: kst
Classification: Applications
Component: general (show other bugs)
Version: 1.x
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: kst
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-06-19 19:51 UTC by Yiwen Mao
Modified: 2008-06-19 23:12 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
This kst file has the plot of the amplitude spectrum described in bug report (9.34 KB, text/plain)
2008-06-19 19:56 UTC, Yiwen Mao
Details
The resulting amplitude spectrum from the Octave (7.57 KB, image/png)
2008-06-19 19:58 UTC, Yiwen Mao
Details
the mfile used to plot the amplitude spectrum in octave (442 bytes, text/plain)
2008-06-19 20:06 UTC, Yiwen Mao
Details
kst file of the simpler case (9.34 KB, text/plain)
2008-06-19 21:09 UTC, Andrew Walker
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yiwen Mao 2008-06-19 19:51:56 UTC
Version:           1.7.0 (using KDE 4.0.1)
Installed from:    Unspecified
Compiler:          Fedora 6 
OS:                Linux

Problem: Use both Octave and Kst to plot the amplitude spectrum of the following function
f=(sin(5*pi*t)).^4+(cos(5*pi*t)).^5,where t ranges from 0 to 3

In Kst, the spectrum is set up as shown below:
The FFT length is 2^7
The sample rate is 265.99
The resulting spectrum is not viewed by an apodization function.
The mean is not removed

In Octave, the following is calculated before plotting the spectrum:
N=2^7;
t=linspace(0,3,N); %t is a vector with N linearly spaced elements between 0 and 3
Ts=t(2)-t(s); %sampling period
Ws=2*pi/Ts; %sampling rate = 265.99
W=Ws*(-N/2:(N/2)-1)/N; %frequecny vector
Comment 1 Yiwen Mao 2008-06-19 19:56:23 UTC
Created attachment 25459 [details]
This kst file has the plot of the amplitude spectrum described in bug report
Comment 2 Yiwen Mao 2008-06-19 19:58:11 UTC
Created attachment 25460 [details]
The resulting amplitude spectrum from the Octave
Comment 3 Yiwen Mao 2008-06-19 20:06:43 UTC
Created attachment 25462 [details]
the mfile used to plot the amplitude spectrum in octave
Comment 4 Andrew Walker 2008-06-19 21:09:41 UTC
Created attachment 25464 [details]
kst file of the simpler case

The attached uses a simple 2*cos(t) function for about 8 cycles to calculate
the amplitude spectrum. Kst identifies the single peak in the amplitude
spectrum as 2.0
Comment 5 Andrew Walker 2008-06-19 23:12:20 UTC
The Kst values look okay.