Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Opus
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexander Traud
Opus
Commits
983f6387
Commit
983f6387
authored
17 years ago
by
Jean-Marc Valin
Browse files
Options
Downloads
Patches
Plain Diff
Wrapper for the TI dsplib FFT
parent
fcb841aa
Loading
Loading
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
libcelt/kfft_single.h
+29
-2
29 additions, 2 deletions
libcelt/kfft_single.h
libcelt/pitch.c
+3
-5
3 additions, 5 deletions
libcelt/pitch.c
with
32 additions
and
7 deletions
libcelt/kfft_single.h
+
29
−
2
View file @
983f6387
...
...
@@ -32,6 +32,31 @@
#ifndef KFFT_SINGLE_H
#define KFFT_SINGLE_H
#ifdef ENABLE_TI_DSPLIB
#include
"dsplib.h"
#define real16_fft_alloc(length) NULL
#define real16_fft_free(state)
#define BITREV(state, i) i
#define real16_fft_inplace(state, X, nx)\
(\
cfft_SCALE(X,nx/2),\
cbrev(X,X,nx/2),\
unpack(X,nx)\
)
#define real16_ifft(state, X, Y, nx) \
(\
unpacki(X, nx),\
cifft_NOSCALE(X,nx/2),\
cbrev(X,Y,nx/2)\
)
#else
/* ENABLE_TI_DSPLIB */
#ifdef FIXED_POINT
#ifdef DOUBLE_PRECISION
...
...
@@ -50,8 +75,10 @@
#define real16_fft_alloc(length) kiss_fftr_alloc_celt_single(length, 0, 0);
#define real16_fft_free(state) kiss_fft_free(state)
#define real16_fft_inplace(state, X) kiss_fftr_inplace(state,X)
#define real16_fft_inplace(state, X
, nx
) kiss_fftr_inplace(state,X)
#define BITREV(state, i) ((state)->substate->bitrev[i])
#define real16_ifft(state, X, Y) kiss_fftri(state,X, Y)
#define real16_ifft(state, X, Y, nx) kiss_fftri(state,X, Y)
#endif
/* !ENABLE_TI_DSPLIB */
#endif
/* KFFT_SINGLE_H */
This diff is collapsed.
Click to expand it.
libcelt/pitch.c
+
3
−
5
View file @
983f6387
...
...
@@ -109,14 +109,12 @@ void find_spectral_pitch(kiss_fftr_cfg fft, const struct PsyDecay *decay, const
VARDECL
(
celt_mask_t
,
curve
);
int
n2
;
int
L2
;
const
int
*
bitrev
;
SAVE_STACK
;
n2
=
lag
/
2
;
L2
=
len
/
2
;
ALLOC
(
X
,
lag
,
celt_word16_t
);
ALLOC
(
curve
,
n2
,
celt_mask_t
);
bitrev
=
fft
->
substate
->
bitrev
;
for
(
i
=
0
;
i
<
lag
;
i
++
)
X
[
i
]
=
0
;
/* Sum all channels of the current frame and copy into X in bit-reverse order */
...
...
@@ -140,7 +138,7 @@ void find_spectral_pitch(kiss_fftr_cfg fft, const struct PsyDecay *decay, const
normalise16
(
X
,
lag
,
8192
);
/*for (i=0;i<lag;i++) printf ("%d ", X[i]);printf ("\n");*/
/* Forward real FFT (in-place) */
real16_fft_inplace
(
fft
,
X
);
real16_fft_inplace
(
fft
,
X
,
lag
);
compute_masking
(
decay
,
X
,
curve
,
lag
);
...
...
@@ -159,7 +157,7 @@ void find_spectral_pitch(kiss_fftr_cfg fft, const struct PsyDecay *decay, const
}
normalise16
(
Y
,
lag
,
8192
);
/* Forward real FFT (in-place) */
real16_fft_inplace
(
fft
,
Y
);
real16_fft_inplace
(
fft
,
Y
,
lag
);
/* Compute cross-spectrum using the inverse masking curve as weighting */
for
(
i
=
1
;
i
<
n2
;
i
++
)
...
...
@@ -179,7 +177,7 @@ void find_spectral_pitch(kiss_fftr_cfg fft, const struct PsyDecay *decay, const
/*for (i=0;i<lag;i++) printf ("%d ", X[i]);printf ("\n");*/
normalise16
(
X
,
lag
,
50
);
/* Inverse half-complex to real FFT gives us the correlation */
real16_ifft
(
fft
,
X
,
Y
);
real16_ifft
(
fft
,
X
,
Y
,
lag
);
/* The peak in the correlation gives us the pitch */
max_corr
=-
VERY_LARGE32
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment