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
// Notes for Arduino LCD Keypad Shield | |
// Create custom character: https://omerk.github.io/lcdchargen/ | |
// String reference: https://www.arduino.cc/en/Reference/StringObject | |
// LCD reference: https://www.arduino.cc/en/Reference/LiquidCrystal | |
// Stream reference: http://playground.arduino.cc/Main/StreamingOutput | |
#define _BYTE(a) _BYTE_CODE(a) | |
#define _HEX(a) _BASED(a, HEX) | |
#define _DEC(a) _BASED(a, DEC) | |
#define _OCT(a) _BASED(a, OCT) |
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
''' | |
Basic implementation of DFT algorithm in Python | |
X_k = sum(x_n * exp(-j*2*PI*k*n/N)) | |
Reference: | |
https://en.wikipedia.org/wiki/Discrete_Fourier_transform | |
''' | |
__author__ = 'Darko Lukic' | |
__email__ = '[email protected]' |
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
''' | |
Basic implementation of Cooley-Tukey FFT algorithm in Python | |
Reference: | |
https://en.wikipedia.org/wiki/Fast_Fourier_transform | |
''' | |
__author__ = 'Darko Lukic' | |
__email__ = '[email protected]' |
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
#include "FFT.h" | |
void fft(int *x_in, | |
std::complex<double> *x_out, | |
int N) { | |
// Make copy of array and apply window | |
for (int i = 0; i < N; i++) { | |
x_out[i] = std::complex<double>(x_in[i], 0); | |
x_out[i] *= 1; // Window |
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
''' | |
Basic implementation of FIR filter with given coefficients | |
Y[n] = sum(f(i)*g(n-i)) | |
''' | |
__author__ = 'Darko Lukic' | |
__email__ = '[email protected]' | |
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
#include "FFT.h" | |
#if defined(MODE_PARALLEL_DEV) || defined(MODE_PARALLEL_TEST) | |
class FFTTask: public task { | |
public: | |
const int N; | |
std::complex<double> *x; | |
FFTTask(std::complex<double> *_x, int _N) : | |
x(_x), N(_N) | |
{} |
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
% Moved from http://pastebin.com/YD8FGFL8 | |
function t = hj(f, x0, step, e) | |
d = eye(length(x0)); | |
t = x0; | |
xb = x0; | |
while step > e | |
% Pretrazivanje u okolini tacke | |
for i = 1:length(d) | |
t_p = t + step * d(i, :); |
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
% Moved from: http://pastebin.com/YD8FGFL8 | |
function out = powel(f, x0, e) | |
[directions, ~] = size(x0); | |
u = eye(directions); | |
t(:, 1) = x0; | |
xNew = x0; | |
while true | |
xOld = xNew |
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
/* | |
Coded by Darko Lukic <[email protected]> | |
Node.js and C++ bindings with events (EventEmitter) | |
*/ | |
#include <nan.h> | |
#include <iostream> | |
using v8::Local; | |
using v8::FunctionTemplate; |
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
#include "Bits.h" | |
void Bits_ByteDump(uint64_t value, uint8_t numberOfBytes) { | |
int8_t i; | |
for (i = numberOfBytes * 8 - 1; i >= 0; i--) { | |
printf("%ld", (value >> i) & 1); | |
if (i % 8 == 0) { | |
printf(" "); |
OlderNewer