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

Decreasing Strength returned from swipep #1

Open
cbare opened this issue May 3, 2016 · 1 comment
Open

Decreasing Strength returned from swipep #1

cbare opened this issue May 3, 2016 · 1 comment

Comments

@cbare
Copy link

cbare commented May 3, 2016

Hi Aaron,

I'm looking at using your swipep implementation in an analysis of voice as an indicator of severity in Parkinson's patients. For some reason, I'm seeing the Strength values returned by the algorithm steadily decrease with each time slice, for example:

t <- 10           # seconds
srate <- 44100    # samples per second
i <- 1:(srate*t)  # index samples
f <- 440          # 440 Hz, A below middle C
amp <- 30000      # 16 bit audio
audio <- as.integer(amp*sin(2*pi*f/srate*i))
frequency_estimates <- swipep(audio, fs=srate, plim=c(50, 500), dt=0.1)

...produces the following output:

> frequency_estimates
    Time Frequency    Strength
1    0.1  429.9493 0.196303029
2    0.2  429.9493 0.143138671
3    0.3  429.9493 0.118090088
4    0.4  429.9493 0.102838482
5    0.5  429.9493 0.092334784
6    0.6  429.9493 0.084570605
7    0.7  429.9493 0.078493448
8    0.8  429.9493 0.073532305
9    0.9  429.9493 0.069337327
10   1.0  429.9493 0.065764178
11   1.1  429.9493 0.062709480
12   1.2  429.9493 0.060080347
13   1.3  429.9493 0.057788197
14   1.4  429.9493 0.055762356
15   1.5  429.9493 0.053921763
16   1.6  429.9493 0.052210601
17   1.7  429.9493 0.050615642
18   1.8  429.9493 0.049152028
19   1.9  429.9493 0.047843326
20   2.0  429.9493 0.046661442
21   2.1  429.9493 0.045584995
22   2.2  429.9493 0.044580839
23   2.3  429.9493 0.043619642
24   2.4  429.9493 0.042675648
25   2.5  429.9493 0.041775361
26   2.6  429.9493 0.040937292
27   2.7  429.9493 0.040184149
28   2.8  429.9493 0.039492410
29   2.9  429.9493 0.038845098
30   3.0  429.9493 0.038217169
31   3.1  429.9493 0.037595788
32   3.2  429.9493 0.036968660
33   3.3  429.9493 0.036371603
34   3.4  429.9493 0.035820394
35   3.5  429.9493 0.035325874
36   3.6  429.9493 0.034865503
37   3.7  429.9493 0.034420800
38   3.8  429.9493 0.033973559
39   3.9  429.9493 0.033518824
40   4.0  429.9493 0.033064829
41   4.1  429.9493 0.032633989
42   4.2  429.9493 0.032246615
43   4.3  429.9493 0.031896017
44   4.4  429.9493 0.031564294
45   4.5  429.9493 0.031228571
46   4.6  429.9493 0.030882556
47   4.7  429.9493 0.030527640
48   4.8  429.9493 0.030180854
49   4.9  429.9493 0.029854276
50   5.0  429.9493 0.029571836
51   5.1  429.9493 0.029309216
52   5.2  429.9493 0.029053097
53   5.3  429.9493 0.028782716
54   5.4  429.9493 0.028499852
55   5.5  429.9493 0.028213267
56   5.6  429.9493 0.027939642
57   5.7  429.9493 0.027689147
58   5.8  429.9493 0.027473452
59   5.9  429.9493 0.027268074
60   6.0  429.9493 0.027056834
61   6.1  429.9493 0.026828242
62   6.2  429.9493 0.026589475
63   6.3  429.9493 0.026355017
64   6.4  429.9493 0.026136070
65   6.5  429.9493 0.025942240
66   6.6  429.9493 0.025770417
67   6.7  429.9493 0.025603639
68   6.8  429.9493 0.025418693
69   6.9  429.9493 0.025219424
70   7.0  429.9493 0.025015782
71   7.1  429.9493 0.024822099
72   7.2  429.9493 0.024645630
73   7.3  429.9493 0.024492547
74   7.4  429.9493 0.024351684
75   7.5  429.9493 0.024210097
76   7.6  429.9493 0.024041726
77   7.7  429.9493 0.023865798
78   7.8  429.9493 0.023690981
79   7.9  429.9493 0.023531164
80   8.0  429.9493 0.023387742
81   8.1  429.9493 0.023264580
82   8.2  429.9493 0.023144842
83   8.3  429.9493 0.023014627
84   8.4  429.9493 0.022862935
85   8.5  429.9493 0.022706193
86   8.6  429.9493 0.022558086
87   8.7  429.9493 0.022426033
88   8.8  429.9493 0.022309139
89   8.9  429.9493 0.022206341
90   9.0  429.9493 0.022100109
91   9.1  429.9493 0.021977407
92   9.2  429.9493 0.021838863
93   9.3  429.9493 0.021699127
94   9.4  429.9493 0.021575390
95   9.5  429.9493 0.021466360
96   9.6  429.9493 0.021371162
97   9.7  429.9493 0.021280686
98   9.8  429.9493 0.021183226
99   9.9  429.9493 0.021065031
100 10.0  429.9493 0.006671747

Since this ought to be a screaming signal and steady all they way through, I'm wondering if this looks like a bug, or if I'm misunderstanding what the results should look like? Thanks!

@cbare
Copy link
Author

cbare commented May 4, 2016

To confirm that this is a bug, I ran the matlab version of swipep (in Octave, thanks Gnu!) and got the following:

t = 10
srate = 44100
i = 1:(srate*t)
f = 440
amp = 30000
audio = int16(amp*sin(2*pi*f/srate*i))
[p,t,s] = swipep(audio, 44100, plim=[50,500], dt|=0.1)

    t       |    p      |   s
------------|-----------+-------------
    0.00000 |   50.000  |   NaN
    0.10000 |  439.237  |   0.67774
    0.20000 |  439.237  |   0.67699
    0.30000 |  439.237  |   0.67642
    0.40000 |  439.237  |   0.67626
    0.50000 |  439.237  |   0.67657
    0.60000 |  439.237  |   0.67726
    0.70000 |  439.237  |   0.67793
    0.80000 |  439.237  |   0.67804
    0.90000 |  439.237  |   0.67739
    1.00000 |  439.237  |   0.67666
    1.10000 |  439.237  |   0.67624
    1.20000 |  439.237  |   0.67637
    1.30000 |  439.237  |   0.67685
    1.40000 |  439.237  |   0.67763
    1.50000 |  439.237  |   0.67804
    1.60000 |  439.237  |   0.67786
    1.70000 |  439.237  |   0.67706
    1.80000 |  439.237  |   0.67636
    1.90000 |  439.237  |   0.67622
    2.00000 |  439.237  |   0.67658
    2.10000 |  439.237  |   0.67717
    2.20000 |  439.237  |   0.67788
    2.30000 |  439.237  |   0.67810
    2.40000 |  439.237  |   0.67748
    2.50000 |  439.237  |   0.67675
    2.60000 |  439.237  |   0.67620
    2.70000 |  439.237  |   0.67633
    2.80000 |  439.237  |   0.67686
    2.90000 |  439.237  |   0.67756
    3.00000 |  439.237  |   0.67800
    3.10000 |  439.237  |   0.67794
    3.20000 |  439.237  |   0.67714
    3.30000 |  439.237  |   0.67648
    3.40000 |  439.237  |   0.67619
    3.50000 |  439.237  |   0.67654
    3.60000 |  439.237  |   0.67727
    3.70000 |  439.237  |   0.67783
    3.80000 |  439.237  |   0.67799
    3.90000 |  439.237  |   0.67756
    4.00000 |  439.237  |   0.67679
    4.10000 |  439.237  |   0.67628
    4.20000 |  439.237  |   0.67627
    4.30000 |  439.237  |   0.67681
    4.40000 |  439.237  |   0.67756
    4.50000 |  439.237  |   0.67798
    4.60000 |  439.237  |   0.67783
    4.70000 |  439.237  |   0.67720
    4.80000 |  439.237  |   0.67650
    4.90000 |  439.237  |   0.67614
    5.00000 |  439.237  |   0.67647
    5.10000 |  439.237  |   0.67720
    5.20000 |  439.237  |   0.67788
    5.30000 |  439.237  |   0.67800
    5.40000 |  439.237  |   0.67759
    5.50000 |  439.237  |   0.67687
    5.60000 |  439.237  |   0.67630
    5.70000 |  439.237  |   0.67615
    5.80000 |  439.237  |   0.67675
    5.90000 |  439.237  |   0.67757
    6.00000 |  439.237  |   0.67804
    6.10000 |  439.237  |   0.67782
    6.20000 |  439.237  |   0.67723
    6.30000 |  439.237  |   0.67656
    6.40000 |  439.237  |   0.67622
    6.50000 |  439.237  |   0.67638
    6.60000 |  439.237  |   0.67713
    6.70000 |  439.237  |   0.67790
    6.80000 |  439.237  |   0.67806
    6.90000 |  439.237  |   0.67758
    7.00000 |  439.237  |   0.67683
    7.10000 |  439.237  |   0.67636
    7.20000 |  439.237  |   0.67624
    7.30000 |  439.237  |   0.67670
    7.40000 |  439.237  |   0.67747
    7.50000 |  439.237  |   0.67817
    7.60000 |  439.237  |   0.67793
    7.70000 |  439.237  |   0.67721
    7.80000 |  439.237  |   0.67658
    7.90000 |  439.237  |   0.67626
    8.00000 |  439.237  |   0.67640
    8.10000 |  439.237  |   0.67704
    8.20000 |  439.237  |   0.67782
    8.30000 |  439.237  |   0.67809
    8.40000 |  439.237  |   0.67765
    8.50000 |  439.237  |   0.67687
    8.60000 |  439.237  |   0.67635
    8.70000 |  439.237  |   0.67633
    8.80000 |  439.237  |   0.67664
    8.90000 |  439.237  |   0.67740
    9.00000 |  439.237  |   0.67802
    9.10000 |  439.237  |   0.67796
    9.20000 |  439.237  |   0.67730
    9.30000 |  439.237  |   0.67654
    9.40000 |  439.237  |   0.67627
    9.50000 |  439.237  |   0.67642
    9.60000 |  439.237  |   0.67699
    9.70000 |  439.237  |   0.67776
    9.80000 |  439.237  |   0.67812
    9.90000 |  439.237  |   0.67774
   10.00000 |  436.960  |   0.15798

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant