-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
740bd62
commit c56ace1
Showing
26 changed files
with
803 additions
and
434 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,13 +5,16 @@ | |
<name>EI-SDK</name> | ||
<license>LICENSE-apache-2.0.txt</license> | ||
<description>Edge Impulse SDK</description> | ||
<url>https://github.com/edgeimpulse/edge-impulse-sdk-pack/releases/download/v1.57.18/</url> | ||
<url>https://github.com/edgeimpulse/edge-impulse-sdk-pack/releases/download/v1.60.2/</url> | ||
<supportContact>[email protected]</supportContact> | ||
<repository type="git">https://github.com/edgeimpulse/edge-impulse-sdk-pack.git</repository> | ||
<releases> | ||
<release version="1.57.18" tag="v1.57.18" date="2024-09-18" url="https://github.com/edgeimpulse/edge-impulse-sdk-pack/releases/download/v1.57.18/EdgeImpulse.EI-SDK.1.57.18.pack"> | ||
<release version="1.60.2" tag="v1.60.2" date="2024-10-14" url="https://github.com/edgeimpulse/edge-impulse-sdk-pack/releases/download/v1.60.2/EdgeImpulse.EI-SDK.1.60.2.pack"> | ||
EI-SDK | ||
</release> | ||
<release version="1.57.18" tag="v1.57.18" date="2024-09-18" url="https://github.com/edgeimpulse/edge-impulse-sdk-pack/releases/download/v1.57.18/EdgeImpulse.EI-SDK.1.57.18.pack"> | ||
EI-SDK | ||
</release> | ||
<release version="1.57.11" tag="v1.57.11" date="2024-09-12" url="https://github.com/edgeimpulse/edge-impulse-sdk-pack/releases/download/v1.57.11/EdgeImpulse.EI-SDK.1.57.11.pack"> | ||
EI-SDK | ||
</release> | ||
|
@@ -98,9 +101,6 @@ | |
</release> | ||
<release version="1.49.38" tag="v1.49.38" date="2024-05-17" url="https://github.com/edgeimpulse/edge-impulse-sdk-pack/releases/download/v1.49.38/EdgeImpulse.EI-SDK.1.49.38.pack"> | ||
EI-SDK | ||
</release> | ||
<release version="1.49.31" tag="v1.49.31" date="2024-05-15" url="https://github.com/edgeimpulse/edge-impulse-sdk-pack/releases/download/v1.49.31/EdgeImpulse.EI-SDK.1.49.31.pack"> | ||
EI-SDK | ||
</release> | ||
</releases> | ||
<keywords> | ||
|
@@ -146,7 +146,7 @@ | |
</packages> | ||
</requirements> | ||
<components> | ||
<component Cclass="EdgeImpulse" Cgroup="SDK" Cversion="1.57.18"> | ||
<component Cclass="EdgeImpulse" Cgroup="SDK" Cversion="1.60.2"> | ||
<description>Edge Impulse SDK</description> | ||
<!-- short component description --> | ||
<files> | ||
|
@@ -355,6 +355,8 @@ | |
<file category="source" name="edgeimpulse/edge-impulse-sdk/porting/stm32-cubeai/debug_log.cpp"/> | ||
<file category="source" name="edgeimpulse/edge-impulse-sdk/porting/arduino/ei_classifier_porting.cpp"/> | ||
<file category="source" name="edgeimpulse/edge-impulse-sdk/porting/arduino/debug_log.cpp"/> | ||
<file category="source" name="edgeimpulse/edge-impulse-sdk/porting/ambiq/ei_classifier_porting.cpp"/> | ||
<file category="source" name="edgeimpulse/edge-impulse-sdk/porting/ambiq/debug_log.cpp"/> | ||
<file category="source" name="edgeimpulse/edge-impulse-sdk/porting/synaptics/ei_classifier_porting.cpp"/> | ||
<file category="source" name="edgeimpulse/edge-impulse-sdk/porting/synaptics/debug_log.cpp"/> | ||
<file category="source" name="edgeimpulse/edge-impulse-sdk/porting/mingw32/ei_classifier_porting.cpp"/> | ||
|
@@ -374,6 +376,7 @@ | |
<file category="header" name="edgeimpulse/edge-impulse-sdk/classifier/ei_aligned_malloc.h"/> | ||
<file category="header" name="edgeimpulse/edge-impulse-sdk/classifier/ei_run_dsp.h"/> | ||
<file category="header" name="edgeimpulse/edge-impulse-sdk/classifier/ei_nms.h"/> | ||
<file category="header" name="edgeimpulse/edge-impulse-sdk/classifier/ei_constants.h"/> | ||
<file category="header" name="edgeimpulse/edge-impulse-sdk/classifier/ei_run_classifier_c.h"/> | ||
<file category="header" name="edgeimpulse/edge-impulse-sdk/classifier/ei_run_classifier.h"/> | ||
<file category="header" name="edgeimpulse/edge-impulse-sdk/classifier/ei_run_classifier_image.h"/> | ||
|
@@ -631,6 +634,8 @@ | |
<file category="header" name="edgeimpulse/edge-impulse-sdk/dsp/kissfft/kissfft.h"/> | ||
<file category="header" name="edgeimpulse/edge-impulse-sdk/dsp/kissfft/kiss_fftr.h"/> | ||
<file category="header" name="edgeimpulse/edge-impulse-sdk/dsp/dct/fast-dct-fft.h"/> | ||
<file category="header" name="edgeimpulse/edge-impulse-sdk/dsp/dsp_engines/ei_arm_cmsis_dsp.h"/> | ||
<file category="header" name="edgeimpulse/edge-impulse-sdk/dsp/dsp_engines/ei_no_hw_dsp.h"/> | ||
<file category="header" name="edgeimpulse/edge-impulse-sdk/porting/ei_classifier_porting.h"/> | ||
<file category="header" name="edgeimpulse/edge-impulse-sdk/porting/ei_logging.h"/> | ||
<file category="header" name="edgeimpulse/edge-impulse-sdk/porting/ethos-core-driver/include/ethosu_driver.h"/> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#ifndef __EI_CONSTANTS__H__ | ||
#define __EI_CONSTANTS__H__ | ||
|
||
#define EI_CLASSIFIER_RESIZE_NONE 0 | ||
#define EI_CLASSIFIER_RESIZE_FIT_SHORTEST 1 | ||
#define EI_CLASSIFIER_RESIZE_FIT_LONGEST 2 | ||
#define EI_CLASSIFIER_RESIZE_SQUASH 3 | ||
|
||
// This exists for linux runner, etc | ||
__attribute__((unused)) static const char *EI_RESIZE_STRINGS[] = { "none", "fit-shortest", "fit-longest", "squash" }; | ||
|
||
#endif //!__EI_CONSTANTS__H__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,81 +1,2 @@ | ||
/* | ||
* Copyright (c) 2022 Project Nayuki. (MIT License) | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an "AS | ||
* IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either | ||
* express or implied. See the License for the specific language | ||
* governing permissions and limitations under the License. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#include <math.h> | ||
#include <stdint.h> | ||
#include <stdlib.h> | ||
#include "fast-dct-fft.h" | ||
#include "../returntypes.hpp" | ||
#include "../numpy.hpp" | ||
#include "../memory.hpp" | ||
|
||
#ifndef M_PI | ||
#define M_PI 3.14159265358979323846264338327950288 | ||
#endif // M_PI | ||
|
||
// DCT type II, unscaled | ||
int ei::dct::transform(float vector[], size_t len) { | ||
const size_t fft_data_out_size = (len / 2 + 1) * sizeof(ei::fft_complex_t); | ||
const size_t fft_data_in_size = len * sizeof(float); | ||
|
||
// Allocate KissFFT input / output buffer | ||
fft_complex_t *fft_data_out = | ||
(ei::fft_complex_t*)ei_dsp_calloc(fft_data_out_size, 1); | ||
if (!fft_data_out) { | ||
return ei::EIDSP_OUT_OF_MEM; | ||
} | ||
|
||
float *fft_data_in = (float*)ei_dsp_calloc(fft_data_in_size, 1); | ||
if (!fft_data_in) { | ||
ei_dsp_free(fft_data_out, fft_data_out_size); | ||
return ei::EIDSP_OUT_OF_MEM; | ||
} | ||
|
||
// Preprocess the input buffer with the data from the vector | ||
size_t halfLen = len / 2; | ||
for (size_t i = 0; i < halfLen; i++) { | ||
fft_data_in[i] = vector[i * 2]; | ||
fft_data_in[len - 1 - i] = vector[i * 2 + 1]; | ||
} | ||
if (len % 2 == 1) { | ||
fft_data_in[halfLen] = vector[len - 1]; | ||
} | ||
|
||
int r = ei::numpy::rfft(fft_data_in, len, fft_data_out, (len / 2 + 1), len); | ||
if (r != 0) { | ||
ei_dsp_free(fft_data_in, fft_data_in_size); | ||
ei_dsp_free(fft_data_out, fft_data_out_size); | ||
return r; | ||
} | ||
|
||
size_t i = 0; | ||
for (; i < len / 2 + 1; i++) { | ||
float temp = i * M_PI / (len * 2); | ||
vector[i] = fft_data_out[i].r * cos(temp) + fft_data_out[i].i * sin(temp); | ||
} | ||
//take advantage of hermetian symmetry to calculate remainder of signal | ||
for (; i < len; i++) { | ||
float temp = i * M_PI / (len * 2); | ||
int conj_idx = len-i; | ||
// second half bins not calculated would have just been the conjugate of the first half (note minus of imag) | ||
vector[i] = fft_data_out[conj_idx].r * cos(temp) - fft_data_out[conj_idx].i * sin(temp); | ||
} | ||
ei_dsp_free(fft_data_in, fft_data_in_size); | ||
ei_dsp_free(fft_data_out, fft_data_out_size); | ||
|
||
return 0; | ||
} | ||
// This file intentinally left blank | ||
// Function moved to numpy.hpp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,7 @@ | ||
/* | ||
* Copyright (c) 2022 Project Nayuki. (MIT License) | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an "AS | ||
* IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either | ||
* express or implied. See the License for the specific language | ||
* governing permissions and limitations under the License. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
#ifndef __FAST_DCT_FFT__H__ | ||
#define __FAST_DCT_FFT__H__ | ||
|
||
|
||
#include <stdbool.h> | ||
#include <stddef.h> | ||
#include "../kissfft/kiss_fft.h" | ||
|
||
namespace ei { | ||
namespace dct { | ||
|
||
int transform(float vector[], size_t len); | ||
int inverse_transform(float vector[], size_t len); | ||
|
||
} // namespace dct | ||
} // namespace ei | ||
// This file intentinally left blank | ||
// Function moved to numpy.hpp | ||
|
||
#endif //!__FAST-DCT-FFT__H__ |
Oops, something went wrong.