Skip to content

Commit ae6f2f9

Browse files
committed
Audio: STFT Process: Add new SOF module
This module provides analysis and synthesis filters for frequency domain processing. The used technique is short term Fourier transform (STFT) and inverse STFT. The FFT length, hop, and window type are configured with the bytes control configuration blob. WIP - the audio quality is not yet good enough Signed-off-by: Seppo Ingalsuo <[email protected]>
1 parent 936200c commit ae6f2f9

File tree

17 files changed

+1602
-3
lines changed

17 files changed

+1602
-3
lines changed

src/audio/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ if(NOT CONFIG_COMP_MODULE_SHARED_LIBRARY_BUILD)
8686
if(CONFIG_COMP_SRC)
8787
add_subdirectory(src)
8888
endif()
89+
if(CONFIG_COMP_STFT_PROCESS)
90+
add_subdirectory(stft_process)
91+
endif()
8992
if(CONFIG_COMP_TDFB)
9093
add_subdirectory(tdfb)
9194
endif()

src/audio/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ rsource "selector/Kconfig"
151151
rsource "smart_amp/Kconfig"
152152
rsource "sound_dose/Kconfig"
153153
rsource "src/Kconfig"
154+
rsource "stft_process/Kconfig"
154155
rsource "tdfb/Kconfig"
155156
rsource "template/Kconfig"
156157
rsource "tensorflow/Kconfig"
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# SPDX-License-Identifier: BSD-3-Clause
2+
3+
if(CONFIG_COMP_STFT_PROCESS STREQUAL "m" AND DEFINED CONFIG_LLEXT)
4+
add_subdirectory(llext ${PROJECT_BINARY_DIR}/stft_process_llext)
5+
add_dependencies(app stft_process)
6+
else()
7+
add_local_sources(sof stft_process.c)
8+
add_local_sources(sof stft_process_setup.c)
9+
add_local_sources(sof stft_process_common.c)
10+
add_local_sources(sof stft_process-generic.c)
11+
12+
if(CONFIG_IPC_MAJOR_3)
13+
add_local_sources(sof stft_process-ipc3.c)
14+
elseif(CONFIG_IPC_MAJOR_4)
15+
add_local_sources(sof stft_process-ipc4.c)
16+
endif()
17+
endif()

src/audio/stft_process/Kconfig

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# SPDX-License-Identifier: BSD-3-Clause
2+
3+
config COMP_STFT_PROCESS
4+
tristate "Template example component"
5+
default y
6+
select MATH_32BIT_FFT
7+
help
8+
Select for stft_process component. Reason for existence
9+
is to provide a minimal component example and use as
10+
placeholder in processing pipelines. As example processing
11+
it swaps or reverses the channels when the switch control
12+
is enabled.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Copyright (c) 2025 Intel Corporation.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
sof_llext_build("stft_process_comp"
5+
SOURCES ../stft_process.c
6+
../stft_process_setup.c
7+
../stft_process_common.c
8+
../stft_process-generic.c
9+
../stft_process-ipc4.c
10+
LIB openmodules
11+
)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#include <tools/rimage/config/platform.toml>
2+
#define LOAD_TYPE "2"
3+
#include "../stft_process_comp.toml"
4+
5+
[module]
6+
count = __COUNTER__

0 commit comments

Comments
 (0)