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
function [wave] = removeLineNoise_SpectrumEstimation(wave, fs, opts) | |
% [wave] = removeLineNoise_SpectrumEstimation(wave, [fs], [opts]) | |
% removeLineNoise_SpectrumEstimation removes line noise (50/60 Hz) from a | |
% (chans/trials x samples) matrix, wave, which is samplel at fs Hz, and | |
% returns the de-noised matrix, wave. | |
% The behaviour of the line noise removal algorithm can be controlled by | |
% an optional input string, 'opts'. The following options are defined: | |
% NH = number of harmonics. (default: 1) | |
% LF = line frequency. (default: 50 Hz) | |
% TOL = error tolerence. (default: 1% tol) |
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
def generate_AST(string): | |
# my implementation is currently supporting negative numbers and decimals, | |
# but not exponentiation | |
number_symbols = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '.', '-'] | |
ind = 1 | |
arr_to_return = [] | |
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
def generate_AST(string): | |
# my implementation is currently supporting negative numbers and decimals, | |
# but not exponentiation | |
number_symbols = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '.', '-'] | |
ind = 1 | |
arr_to_return = [] | |
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
//a solution to this CodeWars kata: https://www.codewars.com/kata/nesting-structure-comparison/javascript | |
Array.prototype.sameStructureAs = function (other) { | |
// Return 'true' if and only if 'other' has the same | |
// nesting structure as 'this'. | |
const isArray = Array.isArray | |
var equal = true |