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

[Release] 1.0.0-beta6 #126

Merged
merged 42 commits into from
Mar 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
ad385e5
Add pointwise inversion to PCA
weefuzzy Sep 30, 2021
06e3470
batchsize was not capped down, leading to hilarious crashes (#63)
tremblap Nov 15, 2021
61d1586
updating credits with the new team
tremblap Nov 15, 2021
4be6a15
Merge pull request #64 from flucoma/giving-credits
weefuzzy Nov 15, 2021
f783bf3
Include SHAs for flucoma-core and current project in version string
weefuzzy Nov 15, 2021
1a36207
Conform version string with SHAs to semantic versioning spec
weefuzzy Nov 15, 2021
eb6e780
Merge pull request #65 from weefuzzy/enhance/version-sha
Nov 24, 2021
5fda001
add chroma feature to NoveltySlice
g-roma Nov 26, 2021
e16d3c4
Toggle BLAS settings for compiling on APPLE (#67)
Nov 28, 2021
0f4a37c
Merge pull request #68 from g-roma/feature/chroma-novelty
Dec 8, 2021
93f83dc
error in the client of (buf)noveltyslice since introducing chroma as …
tremblap Jan 21, 2022
3d67a8e
Enhance/versioning (#75)
weefuzzy Jan 21, 2022
1b4ea03
ensure git is found
Jan 21, 2022
e209449
fix issue #23 - zeroing the output vector in the mTracker loop (#82)
tremblap Jan 24, 2022
0935435
Initial unit tests for `include/data` (#83)
weefuzzy Jan 25, 2022
03710d8
Amend upper frequency limit of mel bands in NoveltySlice to 20kHz
weefuzzy Jan 28, 2022
c59ece5
Merge pull request #87 from weefuzzy/fix/novelty-mfcc-bandwidth
weefuzzy Feb 2, 2022
e8a4982
[Enhance] FluCoMa-wide DataSets as a resource (#88)
Feb 3, 2022
a999094
BufAudioTransport now has A-B based arguments
tedmoore Feb 7, 2022
52159cb
fix mistakenly fixed type signature in FluidSink
weefuzzy Feb 8, 2022
c1d1700
Tests for framing and overlap add bits
weefuzzy Jan 26, 2022
17e0e90
remove build folder caching as a bad job
weefuzzy Feb 8, 2022
c1d7689
Merge pull request #90 from weefuzzy/test/clients/common
weefuzzy Feb 8, 2022
5435ac6
Merge pull request #89 from flucoma/rename-AudioTransport-args
tedmoore Feb 8, 2022
47754d5
Test/sc ports/slicers (#91)
weefuzzy Feb 9, 2022
6a4b370
ignore all build folders for a quieter life
weefuzzy Feb 9, 2022
c93f033
bump Eigen version (#93)
weefuzzy Feb 9, 2022
d80cbb6
add mammoth dataset
Feb 11, 2022
a4bb226
OnsetSlice and NoveltySlice clients: fix block size dependency (#96)
weefuzzy Feb 12, 2022
6c921e1
`SliceIterator::end()` fix (#97)
weefuzzy Feb 14, 2022
2ec78d3
annotate datasets
Feb 14, 2022
18fc8b1
add mfcc for fluid_corpus
Feb 14, 2022
3cf746d
update mfcc dataset
Feb 14, 2022
5a9691e
bump version to beta5 (#101)
Feb 16, 2022
6314901
Add pointwise inversion to PCA
weefuzzy Sep 30, 2021
3a785e5
Merge branch 'feature/invert-pca' of https://github.com/flucoma/fluco…
weefuzzy Mar 8, 2022
973961d
Enhance `ParameterSet` (#103)
weefuzzy Mar 10, 2022
ebbae04
Merge pull request #112 from flucoma/feature/invert-pca
tedmoore Mar 11, 2022
0bbd7ae
[Fix] Make error language more consistent (#118)
Mar 28, 2022
b7c81c3
Enhance/slicer detection curves (#114)
weefuzzy Mar 29, 2022
efcb373
more information on failing test thx
weefuzzy Mar 29, 2022
19837a9
Merge branch 'main' into dev
weefuzzy Mar 30, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/flucoma-core-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,6 @@ jobs:

- name: Test
working-directory: ${{github.workspace}}/build
run: ctest -C ${{env.BUILD_TYPE}} -j3


run: ctest -C ${{env.BUILD_TYPE}} -j3 --output-on-failure

83 changes: 83 additions & 0 deletions include/algorithms/public/Envelope.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
/*
Part of the Fluid Corpus Manipulation Project (http://www.flucoma.org/)
Copyright 2017-2019 University of Huddersfield.
Licensed under the BSD-3 License.
See license.md file in the project root for full license information.
This project has received funding from the European Research Council (ERC)
under the European Union’s Horizon 2020 research and innovation programme
(grant agreement No 725899).
*/

#pragma once

#include "../util/ButterworthHPFilter.hpp"
#include "../util/FluidEigenMappings.hpp"
#include "../util/SlideUDFilter.hpp"
#include "../../data/FluidIndex.hpp"
#include "../../data/TensorTypes.hpp"
#include <Eigen/Core>
#include <cmath>

namespace fluid {
namespace algorithm {

class Envelope
{

using ArrayXd = Eigen::ArrayXd;

public:
void init(double floor, double hiPassFreq)
{
mFastSlide.init(floor);
mSlowSlide.init(floor);
initFilters(hiPassFreq);
mHiPassFreq = hiPassFreq;
mInitialized = true;
}

double processSample(const double in,
double floor, index fastRampUpTime, index slowRampUpTime,
index fastRampDownTime, index slowRampDownTime,
double hiPassFreq)
{
using namespace std;
assert(mInitialized);
mFastSlide.updateCoeffs(fastRampUpTime, fastRampDownTime);
mSlowSlide.updateCoeffs(slowRampUpTime, slowRampDownTime);
double filtered = in;
if (hiPassFreq != mHiPassFreq)
{
initFilters(hiPassFreq);
mHiPassFreq = hiPassFreq;
}
if (mHiPassFreq > 0){
filtered = mHiPass2.processSample(mHiPass1.processSample(in));
}
double rectified = abs(filtered);
double dB = 20 * log10(rectified);
double clipped = max(dB, floor);
double fast = mFastSlide.processSample(clipped);
double slow = mSlowSlide.processSample(clipped);
return fast - slow;
}

bool initialized() { return mInitialized; }

private:
void initFilters(double cutoff)
{
mHiPass1.init(cutoff);
mHiPass2.init(cutoff);
}

double mHiPassFreq{0};
bool mInitialized{false};

ButterworthHPFilter mHiPass1;
ButterworthHPFilter mHiPass2;
SlideUDFilter mFastSlide;
SlideUDFilter mSlowSlide;
};
} // namespace algorithm
} // namespace fluid
82 changes: 45 additions & 37 deletions include/algorithms/public/EnvelopeSegmentation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ under the European Union’s Horizon 2020 research and innovation programme

#pragma once

#include "Envelope.hpp"
#include "../util/ButterworthHPFilter.hpp"
#include "../util/FluidEigenMappings.hpp"
#include "../util/SlideUDFilter.hpp"
Expand All @@ -29,40 +30,46 @@ class EnvelopeSegmentation
public:
void init(double floor, double hiPassFreq)
{
mFastSlide.init(floor);
mSlowSlide.init(floor);
// mFastSlide.init(floor);
// mSlowSlide.init(floor);
mEnvelope.init(floor,hiPassFreq);
mDebounceCount = 1;
initFilters(hiPassFreq);
mHiPassFreq = hiPassFreq;
// initFilters(hiPassFreq);
// mHiPassFreq = hiPassFreq;
mPrevValue = 0;
mState = false;
mInitialized = true;
// mInitialized = true;
}

double processSample(const double in, double onThreshold, double offThreshold,
double floor, index fastRampUpTime, index slowRampUpTime,
index fastRampDownTime, index slowRampDownTime,
double hiPassFreq, index debounce)
{
using namespace std;
assert(mInitialized);
mFastSlide.updateCoeffs(fastRampUpTime, fastRampDownTime);
mSlowSlide.updateCoeffs(slowRampUpTime, slowRampDownTime);
double filtered = in;
if (hiPassFreq != mHiPassFreq)
{
initFilters(hiPassFreq);
mHiPassFreq = hiPassFreq;
}
if (mHiPassFreq > 0){
filtered = mHiPass2.processSample(mHiPass1.processSample(in));
}
double rectified = abs(filtered);
double dB = 20 * log10(rectified);
double clipped = max(dB, floor);
double fast = mFastSlide.processSample(clipped);
double slow = mSlowSlide.processSample(clipped);
double value = fast - slow;
// using namespace std;
// assert(mInitialized);
// mFastSlide.updateCoeffs(fastRampUpTime, fastRampDownTime);
// mSlowSlide.updateCoeffs(slowRampUpTime, slowRampDownTime);
// double filtered = in;
// if (hiPassFreq != mHiPassFreq)
// {
// initFilters(hiPassFreq);
// mHiPassFreq = hiPassFreq;
// }
// if (mHiPassFreq > 0){
// filtered = mHiPass2.processSample(mHiPass1.processSample(in));
// }
// double rectified = abs(filtered);
// double dB = 20 * log10(rectified);
// double clipped = max(dB, floor);
// double fast = mFastSlide.processSample(clipped);
// double slow = mSlowSlide.processSample(clipped);
// double value = fast - slow;


double value =
mEnvelope.processSample(in, floor, fastRampUpTime, slowRampUpTime,
fastRampDownTime, slowRampUpTime, hiPassFreq);
double detected = 0;

if (!mState && value > onThreshold && mPrevValue < onThreshold &&
Expand All @@ -81,25 +88,26 @@ class EnvelopeSegmentation
return detected;
}

bool initialized() { return mInitialized; }
bool initialized() { return mEnvelope.initialized(); }

private:
void initFilters(double cutoff)
{
mHiPass1.init(cutoff);
mHiPass2.init(cutoff);
}

double mHiPassFreq{0};
// void initFilters(double cutoff)
// {
// mHiPass1.init(cutoff);
// mHiPass2.init(cutoff);
// }

Envelope mEnvelope;
// double mHiPassFreq{0};
index mDebounceCount{1};
double mPrevValue{0};
bool mInitialized{false};
// bool mInitialized{false};
bool mState{false};

ButterworthHPFilter mHiPass1;
ButterworthHPFilter mHiPass2;
SlideUDFilter mFastSlide;
SlideUDFilter mSlowSlide;
// ButterworthHPFilter mHiPass1;
// ButterworthHPFilter mHiPass2;
// SlideUDFilter mFastSlide;
// SlideUDFilter mSlowSlide;
};
} // namespace algorithm
} // namespace fluid
62 changes: 62 additions & 0 deletions include/algorithms/public/NoveltyFeature.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/*
Part of the Fluid Corpus Manipulation Project (http://www.flucoma.org/)
Copyright 2017-2019 University of Huddersfield.
Licensed under the BSD-3 License.
See license.md file in the project root for full license information.
This project has received funding from the European Research Council (ERC)
under the European Union’s Horizon 2020 research and innovation programme
(grant agreement No 725899).
*/

#pragma once

#include "../util/FluidEigenMappings.hpp"
#include "../util/Novelty.hpp"
#include "../../data/FluidIndex.hpp"
#include "../../data/TensorTypes.hpp"
#include <Eigen/Core>

namespace fluid {
namespace algorithm {

class NoveltyFeature
{

public:
using ArrayXd = Eigen::ArrayXd;

NoveltyFeature(index maxKernelSize, index maxFilterSize)
: mFilterBufferStorage(maxFilterSize), mNovelty(maxKernelSize)
{}

void init(index kernelSize, index filterSize, index nDims)
{
assert(kernelSize % 2);
mNovelty.init(kernelSize, nDims);
mFilterBuffer = mFilterBufferStorage.segment(0, filterSize);
mFilterBuffer.setZero();
}

double processFrame(const RealVectorView input)
{
double novelty = mNovelty.processFrame(_impl::asEigen<Eigen::Array>(input));
index filterSize = mFilterBuffer.size();

if (filterSize > 1)
{
mFilterBuffer.segment(0, filterSize - 1) =
mFilterBuffer.segment(1, filterSize - 1);
}

mFilterBuffer(filterSize - 1) = novelty;

return mFilterBuffer.mean();
}

private:
ArrayXd mFilterBuffer;
ArrayXd mFilterBufferStorage;
Novelty mNovelty;
};
} // namespace algorithm
} // namespace fluid
29 changes: 9 additions & 20 deletions include/algorithms/public/NoveltySegmentation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ under the European Union’s Horizon 2020 research and innovation programme

#pragma once

#include "NoveltyFeature.hpp"
#include "../util/FluidEigenMappings.hpp"
#include "../util/Novelty.hpp"
#include "../../data/FluidIndex.hpp"
#include "../../data/TensorTypes.hpp"
#include <Eigen/Core>
Expand All @@ -26,32 +26,23 @@ class NoveltySegmentation
using ArrayXd = Eigen::ArrayXd;

NoveltySegmentation(index maxKernelSize, index maxFilterSize)
: mFilterBufferStorage(maxFilterSize), mNovelty(maxKernelSize)
: mNovelty(maxFilterSize, maxKernelSize)
{}

void init(index kernelSize, index filterSize, index nDims)
{
assert(kernelSize % 2);
mNovelty.init(kernelSize, nDims);
mFilterBuffer = mFilterBufferStorage.segment(0, filterSize);
mFilterBuffer.setZero();
mNovelty.init(kernelSize, filterSize, nDims);
mDebounceCount = 1;
}

double processFrame(const RealVectorView input, double threshold,
index minSliceLength)
{
double novelty = mNovelty.processFrame(_impl::asEigen<Eigen::Array>(input));
double detected = 0.;
index filterSize = mFilterBuffer.size();
if (filterSize > 1)
{
mFilterBuffer.segment(0, filterSize - 1) =
mFilterBuffer.segment(1, filterSize - 1);
}

mPeakBuffer.segment(0, 2) = mPeakBuffer.segment(1, 2);
mFilterBuffer(filterSize - 1) = novelty;
mPeakBuffer(2) = mFilterBuffer.mean();
mPeakBuffer(2) = mNovelty.processFrame(input);

if (mPeakBuffer(1) > mPeakBuffer(0) && mPeakBuffer(1) > mPeakBuffer(2) &&
mPeakBuffer(1) > threshold && mDebounceCount == 0)
{
Expand All @@ -66,11 +57,9 @@ class NoveltySegmentation
}

private:
ArrayXd mFilterBuffer;
ArrayXd mFilterBufferStorage;
ArrayXd mPeakBuffer{3};
Novelty mNovelty;
index mDebounceCount{1};
NoveltyFeature mNovelty;
ArrayXd mPeakBuffer{3};
index mDebounceCount{1};
};
} // namespace algorithm
} // namespace fluid
Loading