-
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
21aa989
commit 15ffa8f
Showing
8 changed files
with
173 additions
and
44 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.49.18/</url> | ||
<url>https://github.com/edgeimpulse/edge-impulse-sdk-pack/releases/download/v1.49.21/</url> | ||
<supportContact>[email protected]</supportContact> | ||
<repository type="git">https://github.com/edgeimpulse/edge-impulse-sdk-pack.git</repository> | ||
<releases> | ||
<release version="1.49.18" tag="v1.49.18" date="2024-04-30" url="https://github.com/edgeimpulse/edge-impulse-sdk-pack/releases/download/v1.49.18/EdgeImpulse.EI-SDK.1.49.18.pack"> | ||
<release version="1.49.21" tag="v1.49.21" date="2024-05-03" url="https://github.com/edgeimpulse/edge-impulse-sdk-pack/releases/download/v1.49.21/EdgeImpulse.EI-SDK.1.49.21.pack"> | ||
EI-SDK | ||
</release> | ||
<release version="1.49.18" tag="v1.49.18" date="2024-04-30" url="https://github.com/edgeimpulse/edge-impulse-sdk-pack/releases/download/v1.49.18/EdgeImpulse.EI-SDK.1.49.18.pack"> | ||
EI-SDK | ||
</release> | ||
<release version="1.49.15" tag="v1.49.15" date="2024-04-26" url="https://github.com/edgeimpulse/edge-impulse-sdk-pack/releases/download/v1.49.15/EdgeImpulse.EI-SDK.1.49.15.pack"> | ||
EI-SDK | ||
</release> | ||
|
@@ -125,7 +128,7 @@ | |
</packages> | ||
</requirements> | ||
<components> | ||
<component Cclass="EdgeImpulse" Cgroup="SDK" Cversion="1.49.18"> | ||
<component Cclass="EdgeImpulse" Cgroup="SDK" Cversion="1.49.21"> | ||
<description>Edge Impulse SDK</description> | ||
<!-- short component description --> | ||
<files> | ||
|
@@ -615,6 +618,7 @@ | |
<file category="header" name="edgeimpulse/edge-impulse-sdk/dsp/config.hpp"/> | ||
<file category="header" name="edgeimpulse/edge-impulse-sdk/dsp/numpy.hpp"/> | ||
<file category="header" name="edgeimpulse/edge-impulse-sdk/dsp/memory.hpp"/> | ||
<file category="header" name="edgeimpulse/edge-impulse-sdk/dsp/ei_hr.hpp"/> | ||
<file category="header" name="edgeimpulse/edge-impulse-sdk/dsp/returntypes.hpp"/> | ||
<file category="header" name="edgeimpulse/edge-impulse-sdk/dsp/spectral/filters.hpp"/> | ||
<file category="header" name="edgeimpulse/edge-impulse-sdk/dsp/spectral/feature.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
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 |
---|---|---|
@@ -0,0 +1,96 @@ | ||
/* Edge Impulse inferencing library | ||
* Copyright (c) 2022 EdgeImpulse Inc. | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining a copy | ||
* of this software and associated documentation files (the "Software"), to deal | ||
* in the Software without restriction, including without limitation the rights | ||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
* copies of the Software, and to permit persons to whom the Software is | ||
* furnished to do so, subject to the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be included in | ||
* all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
* SOFTWARE. | ||
*/ | ||
|
||
#ifndef HR_PPG_HPP | ||
#define HR_PPG_HPP | ||
|
||
#include "edge-impulse-sdk/dsp/numpy.hpp" | ||
#include "edge-impulse-sdk/dsp/ei_dsp_handle.h" | ||
#include "edge-impulse-enterprise/hr/hr_ppg.hpp" | ||
|
||
class hr_class : public DspHandle { | ||
public: | ||
int print() override { | ||
ei_printf("Last HR: %f\n", ppg._res.hr); | ||
return ei::EIDSP_OK; | ||
} | ||
|
||
int extract(ei::signal_t *signal, ei::matrix_t *output_matrix, void *config_ptr, const float frequency) override { | ||
using namespace ei; | ||
|
||
// Don't need just yet | ||
// ei_dsp_config_hr_t config = *((ei_dsp_config_hr_t*)config_ptr); | ||
|
||
|
||
// TODO fix for axes / accel | ||
size_t samples_per_inc = ppg.win_inc_samples; | ||
// TODO go in a loop for the full window size, once I can actually test this vs studio | ||
if(signal->total_length != samples_per_inc) { | ||
return EIDSP_BUFFER_SIZE_MISMATCH; | ||
} | ||
|
||
// TODO ask for smaller increments and bp them into place | ||
// Copy into the end of the buffer | ||
matrix_t temp(ppg.axes, samples_per_inc); | ||
signal->get_data(0, samples_per_inc, temp.buffer); | ||
|
||
|
||
output_matrix->buffer[0] = ppg.stream(&temp); | ||
|
||
output_matrix->rows = 1; | ||
output_matrix->cols = 1; | ||
return EIDSP_OK; | ||
} | ||
|
||
// TODO: actually read in config: axes too! | ||
hr_class(float frequency) : ppg(frequency, 1, 8*50, 2*50, true) { | ||
} | ||
|
||
// Boilerplate below here | ||
static DspHandle* create(void* config, float frequency); | ||
|
||
void* operator new(size_t size) { | ||
// Custom memory allocation logic here | ||
return ei_malloc(size); | ||
} | ||
|
||
void operator delete(void* ptr) { | ||
// Custom memory deallocation logic here | ||
ei_free(ptr); | ||
} | ||
// end boilerplate | ||
private: | ||
ei::hr_ppg ppg; | ||
}; | ||
|
||
DspHandle* hr_class::create(void* config_in, float frequency) { // NOLINT def in header is OK at EI | ||
// Don't need just yet | ||
// auto config = reinterpret_cast<ei_dsp_config_hr_t*>(config_in); | ||
// TODO: actually read in config | ||
return new hr_class(frequency); | ||
}; | ||
|
||
/* | ||
NOTE, contact EI sales for license and source to use EI heart rate and heart rate variance functions in deployment | ||
*/ | ||
|
||
#endif |
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