This file contains hidden or 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
% Spectral analysis etudes | |
% This etude demonstrates window function effect on multi-tone signal | |
% - Try to change wtype variable to see the effect | |
% code by [email protected] | |
clear | |
% PARAMETERS | |
% ------------------------------------------------------------------------- |
This file contains hidden or 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
% Spectral analysis etudes | |
% This etude demonstrates window function effect on single-tone signal | |
% code by [email protected] | |
clear | |
% PARAMETERS | |
% ------------------------------------------------------------------------- | |
% Sample rate (Hz) |
This file contains hidden or 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
% Spectral analysis etudes | |
% This etude demonstrates spectrum amplitude error when frequency is not a | |
% product of df by integer | |
% - Try to change f1 variable to see wrong amplitude on spectrum | |
% - Try to change NFFT variable to see zero-padding effect. | |
% code by [email protected] | |
clear | |
% PARAMETERS |
This file contains hidden or 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
% Spectral analysis etudes | |
% This etude demonstrates spectrum for multitone signal with different | |
% amplitudes. | |
% code by [email protected] | |
clear | |
% PARAMETERS | |
% ------------------------------------------------------------------------- |
This file contains hidden or 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
// An example of runtime image generation using Dear ImGui & GLFW | |
// c++ code by [email protected] | |
// Usage: | |
// RuntimeImage m_image; | |
// m_image.setSize(50, 50); | |
// m_image.setColor(255, 0, 255, 255); | |
// m_image.updateTexture(); | |
// ImGui::Image((void*)(intptr_t)m_image.textureId(), m_image.imageSize()); | |
#pragma once |
This file contains hidden or 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
// Linear interpolation procedure | |
// c++ code by [email protected] | |
// SEE | |
// http://www.cplusplus.com/forum/general/216928/ | |
template<typename T> | |
inline T InterpolateLin(const T* data_x, const T* data_y, size_t data_length, T x, size_t& i) | |
{ | |
if (x >= data_x[data_length - 2]) i = data_length - 2; | |
else while (x > data_x[i + 1]) i++; |
This file contains hidden or 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
// Largest-Triangle-Three-Buckets algorithm | |
// SEE | |
// https://github.com/sveinn-steinarsson/flot-downsample | |
// https://www.base.is/flot/ | |
// c++ port by [email protected] | |
template<typename T> | |
inline void DownsampleLTTB(const T* data_x, const T* data_y, size_t data_length, | |
T* sampled_x, T* sampled_y, size_t threshold) | |
{ |