diff --git a/Classes/00_signals/Signal.m b/Classes/00_signals/Signal.m index 71a387c..676d04a 100644 --- a/Classes/00_signals/Signal.m +++ b/Classes/00_signals/Signal.m @@ -254,7 +254,12 @@ classdef Signal CallingModifier = evalin('caller','obj'); end - CallingModifierStruct = obj.objToStructFilteredRecursive(CallingModifier); + if isa(CallingModifier,"Signal") + CallingModifierStruct = obj.objToStructFilteredRecursive(CallingModifier); + ModifierCopy = {CallingModifierStruct}; + end + + ModifierCopy = {CallingModifier}; SignalType = [string(class(obj))]; TimeStamp = [(datetime('now','TimeZone','local','Format','HH:mm:ss'))]; @@ -263,7 +268,7 @@ classdef Signal Nase = [0]; SignalCopy = obj.signal; ModifierName = class(CallingModifier); - ModifierCopy = {CallingModifierStruct}; + cell = {SignalType , TimeStamp , Length , SignalPower(1) , Nase, SignalCopy, ModifierName, ModifierCopy, Description}; diff --git a/Classes/04_DSP/Equalizer/EQ.m b/Classes/04_DSP/Equalizer/EQ.m index 9f528ab..a03d66b 100644 --- a/Classes/04_DSP/Equalizer/EQ.m +++ b/Classes/04_DSP/Equalizer/EQ.m @@ -1,4 +1,4 @@ -classdef EQ %< handle +classdef EQ < handle %EQ Summary of this class goes here % Detailed explanation goes here @@ -289,9 +289,9 @@ classdef EQ %< handle e_dc = e_dc - obj.DCmu*error; - obj.error_log.e_ffe(cnt,trainloops) = e_ffe; - obj.error_log.e_dfe(cnt,trainloops) = e_dfe; - obj.error_log.e_(cnt,trainloops) = error; + % obj.error_log.e_ffe(cnt,trainloops) = e_ffe; + % obj.error_log.e_dfe(cnt,trainloops) = e_dfe; + % obj.error_log.e_(cnt,trainloops) = error; cnt = cnt+1; if obj.Nb(1) > 0 @@ -460,7 +460,7 @@ classdef EQ %< handle if 1%mu_mat ~= 0 e_dc = e_dc - obj.DCmu*error; - error_log(cnt,dd_loop) = e_dc; + % error_log(cnt,dd_loop) = e_dc; cnt = cnt+1; end diff --git a/Classes/04_DSP/Equalizer/Postfilter.m b/Classes/04_DSP/Equalizer/Postfilter.m new file mode 100644 index 0000000..9f72a58 --- /dev/null +++ b/Classes/04_DSP/Equalizer/Postfilter.m @@ -0,0 +1,60 @@ +classdef Postfilter < handle + %NAME Summary of this class goes here + % Detailed explanation goes here + + properties(Access=public) + ncoeff = 2; + burg_coeff = []; + + end + + methods (Access=public) + function obj = Postfilter(options) + %NAME Construct an instance of this class + % Detailed explanation goes here + + arguments + options.ncoeff double = 2 + end + + % + fn = fieldnames(options); + for n = 1:numel(fn) + try + obj.(fn{n}) = options.(fn{n}); + end + end + + % do more stuff + + end + + function signalclass_out = process(obj,signalclass_in,noiseclass_in) + + obj.burg_coeff = arburg(noiseclass_in.signal,obj.ncoeff); + signalclass_in = signalclass_in.filter(obj.burg_coeff,1); + + % append to logbook + lbdesc = ['Postfilter']; + signalclass_in = signalclass_in.logbookentry(lbdesc); + + % write to output + signalclass_out = signalclass_in; + + end + + function showFilter(obj,noiseclass_in) + + noiseclass_in.spectrum('displayname','Noise PSD shifted to 0dBm','fignum',123,'normalizeTo0dB',1); + + [h,w] = freqz(1,obj.burg_coeff,length(noiseclass_in),"whole",noiseclass_in.fs); + h = h/max(abs(h)); + hold on + w_ = (w - noiseclass_in.fs/2); + plot(w_.*1e-9,20*log10(fftshift(h)),'DisplayName',['Burg Coeffs: ', num2str(obj.burg_coeff), ' ']); + + end + + end + +end diff --git a/Classes/04_DSP/Sequence Detection/MLSE.m b/Classes/04_DSP/Sequence Detection/MLSE.m index aad4134..3a780da 100644 --- a/Classes/04_DSP/Sequence Detection/MLSE.m +++ b/Classes/04_DSP/Sequence Detection/MLSE.m @@ -1,4 +1,4 @@ -classdef MLSE +classdef MLSE < handle %MLSE calculates the most probable sequence for an input signal with given/ known channel impulse response of any length properties(Access=public) diff --git a/Classes/DataBaseHandler/DBHandler.m b/Classes/DataBaseHandler/DBHandler.m index b7c2276..2baaaef 100644 --- a/Classes/DataBaseHandler/DBHandler.m +++ b/Classes/DataBaseHandler/DBHandler.m @@ -38,10 +38,22 @@ classdef DBHandler < handle error('Failed to connect to the database: %s', e.message); end - % Get table names and the first rows of each table to understand the structure - obj.getTableNames(); - obj.getTables(); - obj.getDistinctValues(); + if obj.dbIsHealthy + + obj.refresh(); + + else + error('DB seems to be corrupt') + end + + end + + + function obj = refresh(obj) + % Get table names and the first rows of each table to understand the structure + obj.getTableNames(); + obj.getTables(); + obj.getDistinctValues(); end function obj = getTableNames(obj) @@ -86,10 +98,10 @@ classdef DBHandler < handle obj.distinctValues = struct(); % Iterate over each table in obj.tables - tableNames = fieldnames(obj.tables); + tableNames_ = fieldnames(obj.tables); - for i = 1:numel(tableNames) - tableName = tableNames{i}; + for i = 1:numel(tableNames_) + tableName = tableNames_{i}; % Initialize a sub-struct to store distinct values for each field in the table obj.distinctValues.(tableName) = struct(); @@ -101,10 +113,10 @@ classdef DBHandler < handle for j = 1:numel(fieldNames) fieldName = fieldNames{j}; - % Skip fields ending with '_id' as they don't contain useful distinct values - if endsWith(fieldName, '_id') - continue; - end + % % Skip fields ending with '_id' as they don't contain useful distinct values + % if endsWith(fieldName, '_id') + % continue; + % end % Construct SQL to get distinct values for the current field query = sprintf('SELECT DISTINCT %s FROM %s', fieldName, tableName); @@ -123,17 +135,38 @@ classdef DBHandler < handle obj.distinctValues.(tableName).(fieldName) = distinctValues; catch e - warning('Failed to retrieve distinct values for %s.%s: %s', tableName, fieldName, e.message); + % warning('Failed to retrieve distinct values for %s.%s: %s', tableName, fieldName, e.message); obj.distinctValues.(tableName).(fieldName) = []; end end end - % Display the distinct values (optional, for debugging purposes) - disp('Distinct values for each field:'); - disp(obj.distinctValues); end + function healthyDB = dbIsHealthy(obj) + healthyDB = false; + + num_runs = obj.fetch('SELECT COUNT(*) AS total_runs FROM Runs'); + + num_configs = obj.fetch('SELECT COUNT(*) AS total_configurations FROM Configurations'); + + num_meas = obj.fetch('SELECT COUNT(*) AS total_measurements FROM Measurements'); + + assert((num_runs{1,1}==num_configs{1,1})&&(num_configs{1,1}==num_meas{1,1}),'Different num of entries per table'); + + %Check for any duplicate paths + duplictae_raw = obj.fetch("SELECT COALESCE(Runs.rx_raw_path,'NaN') AS rx_raw_path, COUNT(*) AS occurrences FROM Runs GROUP BY rx_raw_path HAVING COUNT(*) > 1"); + duplictae_sync = obj.fetch("SELECT COALESCE(Runs.rx_sync_path,'NaN') AS rx_sync_path, COUNT(*) AS occurrences FROM Runs GROUP BY rx_sync_path HAVING COUNT(*) > 1"); + + if size(duplictae_raw,2) > 1 + for i = 1:size(duplictae_raw,2)-1 + fprintf('Raw Rx Paths: Found %d duplictaes of %s \n',duplictae_raw.occurrences(i),duplictae_raw.rx_raw_path(i)); + end + end + healthyDB = true; + end + + function lastID = appendToTable(obj, tableName, newRow) % appendToTable Appends a new row to the specified table @@ -241,11 +274,87 @@ classdef DBHandler < handle end end + function addBEREntry(obj, berValue, occurrence, runID, ffe, dfe, mlse, pf, eqType, ffe_order, dfe_order, len_tr, mu_ffe, mu_dfe, mu_dc, comment) + % addBEREntry Adds a BER entry linked to an existing or new Equalizer entry. + % Usage: + % addBEREntry(runID, eq, ffe, dfe, mlse, pf, eqType, ffe_order, dfe_order, len_tr, mu_ffe, mu_dfe, mu_dc, berValue, comment) + + if isempty(pf) + postfilter_taps = []; + else + postfilter_taps = pf.burg_coeff; + end + + % Create equalizer data struct for searching and adding if necessary + equalizerData = struct( ... + 'ffe', jsonencode(ffe), ... + 'dfe', jsonencode(dfe), ... + 'mlse', jsonencode(mlse), ... + 'pf', jsonencode(pf), ... + 'eq_type', string(eqType), ... + 'ffe_order', jsonencode(ffe_order), ... + 'dfe_order', jsonencode(dfe_order), ... + 'postfilter_taps',jsonencode(postfilter_taps),... + 'len_tr', len_tr, ... + 'mu_ffe', jsonencode(mu_ffe), ... + 'mu_dfe', mu_dfe, ... + 'mu_dc', mu_dc, ... + 'comment', comment ... + ); + + % Check if exact Equalizer and BER entries already exist in the DB ... + selectedFields = {'Runs.run_id','BERs.ber_id','Equalizer.eq_id','BERs.ber',['BERs.occurrence' ... + '']}; + filterParams = obj.tables; + filterParams.Equalizer = equalizerData; + [dataTable,sql_query] = obj.queryDB(filterParams, selectedFields); + + % get or insert Equalizer + if ~isempty(dataTable) + % Equalizer entry already exists, use the existing eq_id + cur_eq_id = dataTable.eq_id; + else + % Insert the new Equalizer entry + cur_eq_id = obj.appendToTable('Equalizer', equalizerData); + end + + % skip if already here or insert BER entry + if ~isempty(dataTable) + + % A BER entry with the same eq_id, run_id, and occurrence already exists + existingBERValue = dataTable.ber; + + % Compare the existing BER value with the new BER value + if existingBERValue == berValue + fprintf('The BER entry %.2e || -- eq_id: %d -- run_id: %d -- occurrence: %d already exists. \n',berValue, cur_eq_id, runID, occurrence); + else + fprintf('Already found BER for EQ: %.2e ~= %.2e || -- eq_id: %d -- run_id: %d -- occurrence: %d already exists.\n', berValue, existingBERValue, cur_eq_id, runID, occurrence); + end + + else + + % No such BER entry exists, insert the new BER entry + berData = struct( ... + 'run_id', runID, ... + 'eq_id', cur_eq_id, ... + 'ber', berValue, ... + 'occurrence', occurrence ... + ); + + obj.appendToTable('BERs', berData); + + end + + end + + + + function answer = fetch(obj,query) answer = fetch(obj.conn,query); end - function result = getPathsWithFlexibleFilter(obj, filterParams, selectedFields) + function [result,query] = queryDB(obj, filterParams, selectedFields) % getPathsWithFlexibleFilter Retrieves values from Runs table with flexible filtering % and lets the user select which fields to include in the SELECT statement. % @@ -257,8 +366,9 @@ classdef DBHandler < handle % If left empty, two popup windows will prompt the user for input. % % Outputs: - % rxRawPaths: Cell array of values from the Runs table matching the criteria. - % filteredValues: Table of distinct values for parameters included in filterParams. + % result: table with sql return + % query: this was send to SQL DB + arguments obj filterParams = []; @@ -299,7 +409,7 @@ classdef DBHandler < handle fieldName = fieldParts{2}; if isnumeric(obj.tables.(tableName).(fieldName)) - selectClause = [selectClause, 'COALESCE(', selectedFields{i}, ', -1) AS ', fieldName]; + selectClause = [selectClause, 'COALESCE(', selectedFields{i}, ', ''NaN'') AS ', fieldName]; else selectClause = [selectClause, 'COALESCE(', selectedFields{i}, ', '''') AS ', fieldName]; end @@ -321,10 +431,10 @@ classdef DBHandler < handle % Loop through each table in filterParams filterClauses = []; - tableNames = fieldnames(filterParams); + tableNames_ = fieldnames(filterParams); - for t = 1:numel(tableNames) - tableName = tableNames{t}; + for t = 1:numel(tableNames_) + tableName = tableNames_{t}; tableParams = filterParams.(tableName); % Loop through each parameter in the table @@ -343,12 +453,14 @@ classdef DBHandler < handle elseif isnumeric(value) && isnan(value) % If value is NaN, use IS NULL in SQL filterClause = sprintf('%s IS NULL', fullName); - elseif isnumeric(value) + elseif isnumeric(value) && ~isEnumeration(value) filterClause = sprintf('%s = %f', fullName, value); - elseif islogical(value) || (isnumeric(value) && ismember(value, [0, 1])) + elseif islogical(value) || (isnumeric(value) && ismember(value, [0, 1])) && ~isEnumeration(value) filterClause = sprintf('%s = %d', fullName, value); elseif ischar(value) || isstring(value) - filterClause = sprintf('%s = "%s"', fullName, value); + filterClause = sprintf('%s = ''%s''', fullName, char(value)); %nicht nach string suchen sondern nach chararray -> 'bla' statt "bla" + elseif isEnumeration(value) + filterClause = sprintf('%s = ''%s''', fullName, value); else error('Unsupported data type for field "%s".', fullName); end @@ -376,6 +488,7 @@ classdef DBHandler < handle end + function selectedFields = promptSelectFields(obj) % promptSelectFields Prompts the user to select fields from multiple tables to include in the SELECT statement using settingsdlg. @@ -436,41 +549,67 @@ classdef DBHandler < handle % promptFilterParameters Prompts the user to enter filter parameters using the settingsdlg framework. % Get all possible parameters from all tables (excluding sqlite_sequence) - tableNames = fieldnames(obj.tables); - tableNames = setdiff(tableNames, {'sqlite_sequence'}); % Remove sqlite_sequence + tableNames_ = fieldnames(obj.tables); + tableNames_ = setdiff(tableNames_, {'sqlite_sequence'}); % Remove sqlite_sequence % Prepare the inputs for settingsdlg with sections and separators promptSettings = {}; allFieldsFullName = {}; convertedFieldNames = {}; - for i = 1:numel(tableNames) + for i = 1:numel(tableNames_) % Add a separator for each table section promptSettings{end + 1} = 'separator'; - promptSettings{end + 1} = tableNames{i}; + promptSettings{end + 1} = tableNames_{i}; % Get all fields from the current table - tableFields = fieldnames(obj.tables.(tableNames{i})); + tableFields = fieldnames(obj.tables.(tableNames_{i})); % Prepare each field to be added to the dialog for j = 1:numel(tableFields) fieldName = tableFields{j}; - fullName = sprintf('%s.%s', tableNames{i}, fieldName); + fullName = sprintf('%s.%s', tableNames_{i}, fieldName); convertedName = strrep(fullName, '.', '_'); % Replace '.' with '_' + % Skip fields that do not have distinct values stored + if ~isfield(obj.distinctValues.(tableNames_{i}), fieldName) + continue; + end + + % Get the distinct values for the field + distinctValues_ = obj.distinctValues.(tableNames_{i}).(fieldName); + + % Prepare distinct values for dropdown + if isempty(distinctValues_) + % If there are no distinct values, use only an "All" entry + distinctValues_ = {'All'}; + else + % Ensure distinctValues is a cell array of strings + if isnumeric(distinctValues_) + distinctValues_ = arrayfun(@(x) num2str(x), distinctValues_, 'UniformOutput', false); + elseif isstring(distinctValues_) + distinctValues_ = cellstr(distinctValues_); + elseif iscell(distinctValues_) && ~iscellstr(distinctValues_) + distinctValues_ = cellfun(@num2str, distinctValues_, 'UniformOutput', false); + end + + % Add an "All" option at the beginning of the distinct values list + distinctValues_ = [{'All'}; distinctValues_]; + end + allFieldsFullName{end + 1} = fullName; % Add full name to the list convertedFieldNames{end + 1} = convertedName; % Store the converted name % Add the field name and value setting to the prompt promptSettings{end + 1} = {sprintf('%s', fullName), convertedName}; - promptSettings{end + 1} = []; + promptSettings{end + 1} = distinctValues_; % Add distinct values as dropdown options end end % Create the settings dialog [settings, button] = settingsdlg(... 'title', 'Input Parameters for Filtering', ... - 'description', 'Enter the values for each field to filter. Leave empty to include all values. Type NaN for NULL.', ... + 'description', 'Enter the values for each field to filter. Select "All" to include all values.', ... promptSettings{:} ... ); @@ -497,7 +636,7 @@ classdef DBHandler < handle end % Assign values to the respective fields under each table - if isempty(value) + if strcmp(value, 'All') filterParams.(tableName).(fieldName) = []; % Set to empty to include all values elseif isnumeric(value) && isnan(value) filterParams.(tableName).(fieldName) = NaN; % Use NaN to handle as NULL @@ -510,5 +649,6 @@ classdef DBHandler < handle + end end diff --git a/Datatypes/db_mode.m b/Datatypes/db_mode.m new file mode 100644 index 0000000..9b22523 --- /dev/null +++ b/Datatypes/db_mode.m @@ -0,0 +1,9 @@ +classdef db_mode < int32 + + enumeration + no_db (0) + db_precoded (1) + db_encoded (2) + end + +end \ No newline at end of file diff --git a/Datatypes/equalizer_structure.m b/Datatypes/equalizer_structure.m new file mode 100644 index 0000000..263260b --- /dev/null +++ b/Datatypes/equalizer_structure.m @@ -0,0 +1,11 @@ +classdef equalizer_structure < int32 + + enumeration + ffe (0) + vnle (1) + vnle_pf_mlse (2) + db_precoded (3) + db_encoded (4) + end + +end \ No newline at end of file diff --git a/Datatypes/isEnumeration.m b/Datatypes/isEnumeration.m new file mode 100644 index 0000000..048b851 --- /dev/null +++ b/Datatypes/isEnumeration.m @@ -0,0 +1,11 @@ +function result = isEnumeration(value) + % isEnumeration Checks if a given value is an instance of an enumeration class + % Usage: + % result = isEnumeration(value); + + % Get meta information about the class of the value + metaInfo = metaclass(value); + + % Check if the meta information indicates an enumeration class + result = metaInfo.Enumeration; +end \ No newline at end of file diff --git a/Functions/EQ_structures/duobinary_signaling.m b/Functions/EQ_structures/duobinary_signaling.m index 8fd2f80..3f2e8be 100644 --- a/Functions/EQ_structures/duobinary_signaling.m +++ b/Functions/EQ_structures/duobinary_signaling.m @@ -1,4 +1,15 @@ -function duobinary_signaling() +function [eq_signal,eq_noise,ber,numErrors] = duobinary_signaling(EQ, MLSE,M ,rx_signal, tx_symbols, tx_bits) + %Duobinary Signaling + [eq_signal, eq_noise] = EQ.process(rx_signal,tx_symbols); + + eq_signal = MLSE.process(eq_signal); + + eq_signal = Duobinary().decode(eq_signal); + + % M = numel(unique(eq_signal.signal)); + rx_bits = PAMmapper(M,0).demap(eq_signal); + + [~,numErrors,ber,~] = calc_ber(rx_bits.signal,tx_bits.signal,"skip_front",100,"skip_end",150,"returnErrorLocation",1); end \ No newline at end of file diff --git a/Functions/EQ_structures/duobinary_target.m b/Functions/EQ_structures/duobinary_target.m index 2a72291..93ad6bf 100644 --- a/Functions/EQ_structures/duobinary_target.m +++ b/Functions/EQ_structures/duobinary_target.m @@ -1,4 +1,17 @@ -function duobinary_target() +function [eq_signal,eq_noise,ber,numErrors] = duobinary_target(EQ, MLSE,M, rx_signal, tx_symbols, tx_bits) + + %Duobinary Targeting + [eq_signal, eq_noise] = EQ.process(rx_signal,Duobinary().encode(tx_symbols)); + % dir = [1,1]; + eq_signal = MLSE.process(eq_signal); + + eq_signal = Duobinary().decode(eq_signal); + + % M = numel(unique(tx_symbols.signal)); + rx_bits = PAMmapper(M,0).demap(eq_signal); + + [~,numErrors,ber,~] = calc_ber(rx_bits.signal,tx_bits.signal,"skip_front",100,"skip_end",150,"returnErrorLocation",1); + end \ No newline at end of file diff --git a/Functions/EQ_structures/vnle.m b/Functions/EQ_structures/vnle.m index 508b2e3..6b32987 100644 --- a/Functions/EQ_structures/vnle.m +++ b/Functions/EQ_structures/vnle.m @@ -1,4 +1,25 @@ -function eq_signal = vnle(EQ,rx_signal,tx_symbols) - %VNLE - eq_signal = EQ.process(rx_signal,tx_symbols); +function [eq_signal,eq_noise,ber,numErrors] = vnle(EQ,M,rx_signal,tx_symbols,tx_bits) + %VNLE Apply an equalization algorithm to the received signal and calculate BER + % This function takes an equalizer object, a received signal, and the + % transmitted symbols to apply equalization, map the received signal back to bits, + % and compute the bit error rate (BER). + % + % Inputs: + % EQ - Equalizer object that provides the equalization method + % rx_signal - Received signal that needs to be equalized + % tx_symbols - Transmitted symbols used as a reference for BER calculation + % + % Outputs: + % eq_signal - Equalized version of the received signal + % ber - Bit error rate after equalization + % numErrors - Number of bit errors detected + + %FFE or VNLE + [eq_signal,eq_noise] = EQ.process(rx_signal,tx_symbols); + + % M = numel(unique(tx_symbols.signal)); + rx_bits = PAMmapper(M,0).demap(eq_signal); + + [~,numErrors,ber,~] = calc_ber(rx_bits.signal,tx_bits.signal,"skip_front",100,"skip_end",150,"returnErrorLocation",1); + end \ No newline at end of file diff --git a/Functions/EQ_structures/vnle_postfilter_mlse.m b/Functions/EQ_structures/vnle_postfilter_mlse.m index 3feb3ea..a022b19 100644 --- a/Functions/EQ_structures/vnle_postfilter_mlse.m +++ b/Functions/EQ_structures/vnle_postfilter_mlse.m @@ -1,4 +1,18 @@ -function vnle_postfilter_mlse() +function [eq_signal,eq_noise,ber,numErrors] = vnle_postfilter_mlse(eq_,pf_,mlse_,M,rx_signal,tx_symbols,tx_bits) + + %FFE or VNLE + [eq_signal,eq_noise] = eq_.process(rx_signal,tx_symbols); + eq_signal = pf_.process(eq_signal,eq_noise); + %M = numel(unique(tx_symbols.signal)); + mlse_.DIR = pf_.burg_coeff; + mlse_.trellis_states = PAMmapper(M,0).levels; + mlse_.M = M; + eq_signal = mlse_.process(eq_signal); + + rx_bits = PAMmapper(M,0).demap(eq_signal); + + [~,numErrors,ber,~] = calc_ber(rx_bits.signal,tx_bits.signal,"skip_front",100,"skip_end",150,"returnErrorLocation",1); + end \ No newline at end of file diff --git a/Functions/holdAndShowValue.m b/Functions/Lab_helper/holdAndShowValue.m similarity index 100% rename from Functions/holdAndShowValue.m rename to Functions/Lab_helper/holdAndShowValue.m diff --git a/Functions/showCurrentMeasurement.m b/Functions/Lab_helper/showCurrentMeasurement.m similarity index 97% rename from Functions/showCurrentMeasurement.m rename to Functions/Lab_helper/showCurrentMeasurement.m index dc316f6..fb08670 100644 --- a/Functions/showCurrentMeasurement.m +++ b/Functions/Lab_helper/showCurrentMeasurement.m @@ -1,5 +1,8 @@ function showCurrentMeasurement(varargin) - % showCurrentMeasurement displays measurement data in a figure with variable names + + % USEFUL FOR LAB! + + % showCurrentMeasurement displays lab measurement data in a table figure with variable names % as column headers and values listed below. Calling the function multiple times % with the same variable names but different values adds more data points. % diff --git a/Functions/waitUntilClick.m b/Functions/Lab_helper/waitUntilClick.m similarity index 100% rename from Functions/waitUntilClick.m rename to Functions/Lab_helper/waitUntilClick.m diff --git a/Functions/helper_functions_community/cbrewer2/cbrewer2.m b/Functions/helper_functions_community/cbrewer2/cbrewer2.m deleted file mode 100644 index dcdc2ec..0000000 --- a/Functions/helper_functions_community/cbrewer2/cbrewer2.m +++ /dev/null @@ -1,260 +0,0 @@ -%CBREWER2 Interpolated versions of Cynthia Brewer's ColorBrewer colormaps -% CBREWER2(CNAME, NCOL) returns the colour scheme CNAME with the number -% of colours equal to NCOL. If there is a ColorBrewer scheme with exactly -% this number of colours, the color scheme is returned as-is. If NCOL -% larger (or smaller) than the designed colormaps for this scheme, the -% largest (smallest) one is interpolated to provide enough colours, -% unless the requested colour scheme CNAME is a qualitative palette. For -% a qualitative scheme, the colours are repeated, cycling from the -% beginning again, to output the requested NCOL colours. -% -% CBREWER2(CNAME) without an NCOL input will use the same number of -% colours as the current colormap. -% -% CBREWER2(CNAME, NCOL, INTERP_METHOD) allows you to change the method -% used for the interpolation. The default is 'cubic'. -% -% CBREWER2(CNAME, NCOL, INTERP_METHOD, INTERP_SPACE) allows you to -% change the colorspace used for the interpolation. By default, this is -% in the CIELAB colorspace, which is approximately perceptually uniform. -% Options for INTERP_SPACE are -% 'rgb' : interpolation in sRGB (as used in original CBREWER) -% 'lab' : interpolation in CIELAB (default) -% 'lch' : interpolation in CIELCH_ab (not recommended due to the -% discontinuities at C=0 and H=0) -% Anything else supported by COLORSPACE will also function. -% -% The input format CBREWER2(TYPE, ...) can also be used, where TYPE is -% one of 'seq', 'div', 'qual'. This input is redandant and will be -% ignored. This input format is provided for backwards compatibility with -% the original CBREWER. -% -% Example 1 (sequential heatmap): -% C = [0 2 4 6; 8 10 12 14; 16 18 20 22]; -% imagesc(C); -% colorbar; -% colormap(cbrewer('YlOrRd', 256); -% -% Example 2 (line plot): -% x = 0:0.01:2; -% sc = [0.5; 1; 2]; -% t0 = [0; 0.2; 0.4]; -% t = bsxfun(@rdivide, bsxfun(@plus, x, t0), sc); -% y = sin(t * 2 * pi); -% cmap = cbrewer2('Set1', numel(sc)); -% axes('ColorOrder', cmap, 'NextPlot', 'ReplaceChildren'); -% plot(x, y); -% -% Example 3 (divergent heatmap): -% [X,Y,Z] = peaks(30); -% surfc(X,Y,Z); -% colormap(cbrewer2('RdBu')); -% -% This product includes color specifications and designs developed by -% Cynthia Brewer (http://colorbrewer.org/). For more information on -% ColorBrewer, please visit http://colorbrewer.org/. -% -% CBREWER2 uses a cached copy of the Cynthia Brewer color schemes which -% was converted to .mat format by Charles Robert for use with CBREWER. -% CBREWER is available from the MATLAB FileExchange under the MIT license. -% -% See also CBREWER, BREWERMAP, COLORSPACE, INTERP1. - - -% Copyright (c) 2016 Scott Lowe -% -% Licensed under the Apache License, Version 2.0 (the "License"); -% you may not use this file except in compliance with the License. -% You may obtain a copy of the License at -% -% http://www.apache.org/licenses/LICENSE-2.0 -% -% Unless required by applicable law or agreed to in writing, software -% distributed under the License is distributed on an "AS IS" BASIS, -% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -% See the License for the specific language governing permissions and -% limitations under the License. - - -function colormap = cbrewer2(... - cname, ncol, interp_method, interp_space, varargin) - -% Definitions ------------------------------------------------------------- - -% List of all of Cynthia Brewer's colormaps and their types -% seq: sequential -% div: divergent -% qual: qualitative -cbdict = {... - 'Blues', 'seq'; ... - 'BuGn', 'seq'; ... - 'BuPu', 'seq'; ... - 'GnBu', 'seq'; ... - 'Greens', 'seq'; ... - 'Greys', 'seq'; ... - 'Oranges', 'seq'; ... - 'OrRd', 'seq'; ... - 'PuBu', 'seq'; ... - 'PuBuGn', 'seq'; ... - 'PuRd', 'seq'; ... - 'Purples', 'seq'; ... - 'RdPu', 'seq'; ... - 'Reds', 'seq'; ... - 'YlGn', 'seq'; ... - 'YlGnBu', 'seq'; ... - 'YlOrBr', 'seq'; ... - 'YlOrRd', 'seq'; ... - 'BrBG', 'div'; ... - 'PiYG', 'div'; ... - 'PRGn', 'div'; ... - 'PuOr', 'div'; ... - 'RdBu', 'div'; ... - 'RdGy', 'div'; ... - 'RdYlBu', 'div'; ... - 'RdYlGn', 'div'; ... - 'Spectral', 'div'; ... - 'Accent', 'qual'; ... - 'Dark2', 'qual'; ... - 'Paired', 'qual'; ... - 'Pastel1', 'qual'; ... - 'Pastel2', 'qual'; ... - 'Set1', 'qual'; ... - 'Set2', 'qual'; ... - 'Set3', 'qual'; ... - }; - - -% Input handling ---------------------------------------------------------- - -narginchk(1, 5); - -% Initialise variables if not supplied -if nargin<2 - ncol = []; -end -if nargin<3 - interp_method = []; -end -if nargin<4 - interp_space = []; -end -if nargin<5 - varargin = {[]}; -end - -% Check if the colormap type was unnecessarily input -types = unique(cbdict(:, 2)); -if nargin > 1 && ischar(cname) && ischar(ncol) - LI = ismember({cname ncol}, types); - if ~any(LI); error('Number of colors cannot be a string'); end; - if all(LI); error('Incorrect colormap name'); end; - if LI(1) - vgn = {cname; ncol; interp_method; interp_space}; - cname = vgn{2}; - ncol = vgn{3}; - interp_method = vgn{4}; - interp_space = varargin{1}; - ctype_input = vgn{1}; - elseif LI(2) - vgn = {cname; ncol; interp_method; interp_space}; - cname = vgn{1}; - ncol = vgn{3}; - interp_method = vgn{4}; - interp_space = varargin{1}; - ctype_input = vgn{2}; - end -else - ctype_input = ''; -end - -% Default values -if isempty(ncol) - % Number of colours in the colormap - ncol = size(get(gcf,'colormap'), 1); -end -if isempty(interp_method) - interp_method = 'pchip'; -end -if isempty(interp_space) - interp_space = 'lab'; -end - - -% Load colorbrewer data --------------------------------------------------- -Tmp = load('colorbrewer.mat'); -colorbrewer = Tmp.colorbrewer; - -[TF, idict] = ismember(lower(cname), lower(cbdict(:, 1))); - -if ~TF - error('%s is not a recognised Brewer colormap',cname); -end - -cname = cbdict{idict, 1}; -ctype = cbdict{idict, 2}; - -if (~isfield(colorbrewer.(ctype), cname)) - error('Colormap %s is not present in loaded data',cname); -end - - -% Main script ------------------------------------------------------------- - -if ncol > length(colorbrewer.(ctype).(cname)) - % If we specified too many colours, we take the maximum and interpolate - colormap = colorbrewer.(ctype).(cname){length(colorbrewer.(ctype).(cname))}; - colormap = colormap ./ 255; -elseif isempty(colorbrewer.(ctype).(cname){ncol}) - % If we specified too few colours, we take the minimum and interpolate - nmin = find(~cellfun(@isempty, colorbrewer.(ctype).(cname)), 1); - colormap = colorbrewer.(ctype).(cname){nmin}; - colormap = colormap./255; -else - % If we specified a number of colours in the pre-designed range, no - % need to interpolate - colormap = (colorbrewer.(ctype).(cname){ncol}) ./ 255; - return; -end - -% Don't interpolate if qualitative type -if strcmp(ctype,'qual') - if size(colormap, 1) >= ncol - colormap = colormap(1:ncol, :); - return; - end - warning('CBREWER2:QualTooManyColors', ... - ['Too many colors requested: cannot interpolate a qualitative' ... - ' colorscheme']); - % Cycle the colours from the beginning again, so we have enough to - % return - colormap = repmat(colormap, ceil(ncol / size(colormap, 1)), 1); - colormap = colormap(1:ncol, :); - return; -end - -% Make sure we have colorspace downloaded from the FEX -if ~strcmpi(interp_space, 'rgb') && ~exist('colorspace.m', 'file') - P = requireFEXpackage(28790); - if isempty(P); - error(... - ['You need to download COLORSPACE from the MATLAB FEX and' ... - ' add it to the MATLAB path.']); - end; -end - -% Move to perceptually uniform space -if ~strcmpi(interp_space,'rgb') - colormap = colorspace(['rgb->' interp_space], colormap); -end - -% Linearly interpolate -X = linspace(0, 1, size(colormap, 1)); -XI = linspace(0, 1, ncol); -colormap = interp1(X, colormap, XI, interp_method); - -% Move from perceptually uniform space back to sRGB -if ~strcmpi(interp_space,'rgb') - colormap = colorspace(['rgb<-' interp_space], colormap); -end - -end \ No newline at end of file diff --git a/Functions/helper_functions_community/cbrewer2/colorbrewer.mat b/Functions/helper_functions_community/cbrewer2/colorbrewer.mat deleted file mode 100644 index ec59ef4..0000000 Binary files a/Functions/helper_functions_community/cbrewer2/colorbrewer.mat and /dev/null differ diff --git a/Functions/helper_functions_community/cbrewer2/requireFEXpackage.m b/Functions/helper_functions_community/cbrewer2/requireFEXpackage.m deleted file mode 100644 index 86838cc..0000000 --- a/Functions/helper_functions_community/cbrewer2/requireFEXpackage.m +++ /dev/null @@ -1,194 +0,0 @@ -function AddedPath = requireFEXpackage(FEXSubmissionID) -%Function requireFEXpackage - -%installs Matlab Central File Exchange (FEX) submission -%with given ID into the directory chosen by the user. -%A new FEX submissions may use previous FEX submissions as its part. -%The function 'requireFEXpackage' helps in adding those previous -%submissions to the user's MATLAB installation. -% -%This function is a part of File Exchange submission 31069. -%Download the entire submission: -%http://www.mathworks.com/matlabcentral/fileexchange/31069 -% -% SYNTAX: -% AddedPath = requireFEXpackage(FEXSubmissionID) -% -% INPUT: -% ID of the required submission to File Exchange -% -% OUTPUT: -% the path to that submission added to the user's MATLAB path. -% -% HOW TO CALL: -% The command -% P = requireFEXpackage(8277) -% will download and install the package with ID 8277 -% (namely, nice 'fminsearchbnd' by John D'Errico) -% -% EXAMPLES -- HOW TO USE: -% -% EXAMPLE 1 (using 'exist' command): -% -% % first, somewhere in the very beginning of your code, -% % check if the function 'fminsearchbnd' from the FEX package 8277 -% % is on your MATLAB path, and if it is not there, -% % require the FEX package 8277: -% if ~(exist('fminsearchbnd', 'file') == 2) -% P = requireFEXpackage(8277); % fminsearchbnd is part of 8277 -% end -% -% % Then just use 'fminsearchbnd' where you need it: -% syms x -% RosenbrockBananaFunction = @(x) (1-x(1)).^2 + 100*(x(2)-x(1).^2).^2; -% x = fminsearchbnd(RosenbrockBananaFunction,[3 3]) - -% EXAMPLE 2 (using 'try-catch' command): -% -% syms x -% RosenbrockBananaFunction = @(x) (1-x(1)).^2+100*(x(2)-x(1).^2).^2; -% try -% % if function 'fminsearchbnd' already exists in your MATLAB -% % installation, just use it: -% x = fminsearchbnd(RosenbrockBananaFunction,[3 3]) -% catch -% % if function 'fminsearchbnd' is not present in your MATLAB -% % installation, first get the package 8277 (to which it belongs) -% % from the MATLAB Central File Exchange (FEX) -% P = requireFEXpackage(8277); % fminsearchbnd is part of 8277 -% % and then use that function: -% x = fminsearchbnd(RosenbrockBananaFunction,[3 3]) -% end -% -% -% NOTE: on Mac platform, the title of the dialog box for -% choosing the directory for installing the required FEX package -% is not shown; this is not a bug, this is how UIGETDIR works on Macs -- -% see the documentation for UIGETDIR -% http://www.mathworks.com/help/techdoc/ref/uigetdir.html -% -% (C) Igor Podlubny, 2011 - -% Copyright (c) 2011, Igor Podlubny -% All rights reserved. -% -% Redistribution and use in source and binary forms, with or without -% modification, are permitted provided that the following conditions are -% met: -% -% * Redistributions of source code must retain the above copyright -% notice, this list of conditions and the following disclaimer. -% * Redistributions in binary form must reproduce the above copyright -% notice, this list of conditions and the following disclaimer in -% the documentation and/or other materials provided with the distribution -% -% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -% AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -% IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -% ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -% LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -% CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -% SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -% INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -% CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -% ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -% POSSIBILITY OF SUCH DAMAGE. - - -ID = num2str(FEXSubmissionID); - -% Ask user for the confirmation of the installation -% of the required FEX package -yes = ['YES, Install package ' ID]; -no = 'NO, do not install'; -userchoice = questdlg(['The Matlab function/toolbox, which you are running, ' ... - 'requires the presence of the package ' ID ... - ' from Matlab Central File Exchange.' ... - sprintf('\n\n') ... - 'Would you like to install the FEX package ' ID ' now?'] , ... - ['Required package ' ID], ... - yes, no, yes); - -% Handle response -switch userchoice - case yes, - install = 1; - case no, - install = 0; - otherwise, - install = 0; -end - - -if install == 1 - baseURL = 'http://www.mathworks.com/matlabcentral/fileexchange/'; - query = '?download=true'; - - location = uigetdir(pwd, ['Select the directory for installing the required FEX package' ID ]); - if location ~= 0 - % download package 'ID' from Matlab Central File Exchange - filetosave = [location filesep ID '.zip']; - FEXpackage = [baseURL ID query]; - [f,status] = urlwrite(FEXpackage,filetosave); - if status==0 - warndlg(['No connection to Matlab Central File Exchange,' ' or package ' ID ' does not exist.' ... - ' Package ' ID ' has not been installed. ' ... - ' Check you internet settings and the ID of the required package, and try again. '] , ... - ['No connection to Matlab Central File Exchange' ' or package ' ID ' does not exist'], ... - 'modal'); - AddedPath = ''; - return - end - % unzip the downloaded file to the subdirectory 'ID' - todir = [location filesep ID]; - % if the directory 'ID' doesn't exist at given location, create it - if ~(exist([location filesep ID], 'dir') == 7) - mkdir(location, ID); - end - try - unzip(filetosave, todir); - % after unzipping, delete the downloaded ZIP file - delete(filetosave); - % prepend the paths to the downloaded package to the MATLAB path - P = genpath([location filesep ID]); - path(P,path); - catch - % if the FEX package is not ZIP, then it is a single m-file - % just move the file to the ID directory - [pathstr, name, ext] = fileparts(filetosave); - movefile(filetosave, [todir filesep name '.m']); - P = genpath([location filesep ID]); - path(P,path); - end - else - P = ''; - end - - AddedPath = P; -else - AddedPath = ''; -end - - -if install == 1, - % Ask user about reviewing and saving the modified MATLAB path, - % and take him to PATHTOOL, if the user wants to save the modified path - yes = 'YES, I want to review and save the MATLAB path'; - no = 'NO, I don''t want to save the path permanently'; - userchoice = questdlg(['After adding the package ' ID ... - ' from Matlab Central File Exchange to your MATLAB installation,' ... - ' the MATLAB path has been modified accordingly. ', ... - 'Would you like to review and save the modified MATLAB path?'] , ... - 'Review and save the modified MATLAB path for future use?', ... - yes, no, yes); - - % Handle response - switch userchoice - case yes, - pathtool; - case no, - otherwise, - end -end - - - diff --git a/Functions/helper_functions_community/linspecer.m b/Functions/helper_functions_community/linspecer.m deleted file mode 100644 index 31c5e6e..0000000 --- a/Functions/helper_functions_community/linspecer.m +++ /dev/null @@ -1,261 +0,0 @@ -% function lineStyles = linspecer(N) -% This function creates an Nx3 array of N [R B G] colors -% These can be used to plot lots of lines with distinguishable and nice -% looking colors. -% -% lineStyles = linspecer(N); makes N colors for you to use: lineStyles(ii,:) -% -% colormap(linspecer); set your colormap to have easily distinguishable -% colors and a pleasing aesthetic -% -% lineStyles = linspecer(N,'qualitative'); forces the colors to all be distinguishable (up to 12) -% lineStyles = linspecer(N,'sequential'); forces the colors to vary along a spectrum -% -% % Examples demonstrating the colors. -% -% LINE COLORS -% N=6; -% X = linspace(0,pi*3,1000); -% Y = bsxfun(@(x,n)sin(x+2*n*pi/N), X.', 1:N); -% C = linspecer(N); -% axes('NextPlot','replacechildren', 'ColorOrder',C); -% plot(X,Y,'linewidth',5) -% ylim([-1.1 1.1]); -% -% SIMPLER LINE COLOR EXAMPLE -% N = 6; X = linspace(0,pi*3,1000); -% C = linspecer(N) -% hold off; -% for ii=1:N -% Y = sin(X+2*ii*pi/N); -% plot(X,Y,'color',C(ii,:),'linewidth',3); -% hold on; -% end -% -% COLORMAP EXAMPLE -% A = rand(15); -% figure; imagesc(A); % default colormap -% figure; imagesc(A); colormap(linspecer); % linspecer colormap -% -% See also NDHIST, NHIST, PLOT, COLORMAP, 43700-cubehelix-colormaps -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% by Jonathan Lansey, March 2009-2013 – Lansey at gmail.com % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -%% credits and where the function came from -% The colors are largely taken from: -% http://colorbrewer2.org and Cynthia Brewer, Mark Harrower and The Pennsylvania State University -% -% -% She studied this from a phsychometric perspective and crafted the colors -% beautifully. -% -% I made choices from the many there to decide the nicest once for plotting -% lines in Matlab. I also made a small change to one of the colors I -% thought was a bit too bright. In addition some interpolation is going on -% for the sequential line styles. -% -% -%% - -function lineStyles=linspecer(N,varargin) - -if nargin==0 % return a colormap - lineStyles = linspecer(128); - return; -end - -if ischar(N) - lineStyles = linspecer(128,N); - return; -end - -if N<=0 % its empty, nothing else to do here - lineStyles=[]; - return; -end - -% interperet varagin -qualFlag = 0; -colorblindFlag = 0; - -if ~isempty(varargin)>0 % you set a parameter? - switch lower(varargin{1}) - case {'qualitative','qua'} - if N>12 % go home, you just can't get this. - warning('qualitiative is not possible for greater than 12 items, please reconsider'); - else - if N>9 - warning(['Default may be nicer for ' num2str(N) ' for clearer colors use: whitebg(''black''); ']); - end - end - qualFlag = 1; - case {'sequential','seq'} - lineStyles = colorm(N); - return; - case {'white','whitefade'} - lineStyles = whiteFade(N);return; - case 'red' - lineStyles = whiteFade(N,'red');return; - case 'blue' - lineStyles = whiteFade(N,'blue');return; - case 'green' - lineStyles = whiteFade(N,'green');return; - case {'gray','grey'} - lineStyles = whiteFade(N,'gray');return; - case {'colorblind'} - colorblindFlag = 1; - otherwise - warning(['parameter ''' varargin{1} ''' not recognized']); - end -end -% *.95 -% predefine some colormaps - set3 = colorBrew2mat({[141, 211, 199];[ 255, 237, 111];[ 190, 186, 218];[ 251, 128, 114];[ 128, 177, 211];[ 253, 180, 98];[ 179, 222, 105];[ 188, 128, 189];[ 217, 217, 217];[ 204, 235, 197];[ 252, 205, 229];[ 255, 255, 179]}'); -set1JL = brighten(colorBrew2mat({[228, 26, 28];[ 55, 126, 184]; [ 77, 175, 74];[ 255, 127, 0];[ 255, 237, 111]*.85;[ 166, 86, 40];[ 247, 129, 191];[ 153, 153, 153];[ 152, 78, 163]}')); -set1 = brighten(colorBrew2mat({[ 55, 126, 184]*.85;[228, 26, 28];[ 77, 175, 74];[ 255, 127, 0];[ 152, 78, 163]}),.8); - -% colorblindSet = {[215,25,28];[253,174,97];[171,217,233];[44,123,182]}; -colorblindSet = {[215,25,28];[253,174,97];[171,217,233]*.8;[44,123,182]*.8}; - -set3 = dim(set3,.93); - -if colorblindFlag - switch N - % sorry about this line folks. kind of legacy here because I used to - % use individual 1x3 cells instead of nx3 arrays - case 4 - lineStyles = colorBrew2mat(colorblindSet); - otherwise - colorblindFlag = false; - warning('sorry unsupported colorblind set for this number, using regular types'); - end -end -if ~colorblindFlag - switch N - case 1 - lineStyles = { [ 55, 126, 184]/255}; - case {2, 3, 4, 5 } - lineStyles = set1(1:N); - case {6 , 7, 8, 9} - lineStyles = set1JL(1:N)'; - case {10, 11, 12} - if qualFlag % force qualitative graphs - lineStyles = set3(1:N)'; - else % 10 is a good number to start with the sequential ones. - lineStyles = cmap2linspecer(colorm(N)); - end - otherwise % any old case where I need a quick job done. - lineStyles = cmap2linspecer(colorm(N)); - end -end -lineStyles = cell2mat(lineStyles); - -end - -% extra functions -function varIn = colorBrew2mat(varIn) -for ii=1:length(varIn) % just divide by 255 - varIn{ii}=varIn{ii}/255; -end -end - -function varIn = brighten(varIn,varargin) % increase the brightness - -if isempty(varargin), - frac = .9; -else - frac = varargin{1}; -end - -for ii=1:length(varIn) - varIn{ii}=varIn{ii}*frac+(1-frac); -end -end - -function varIn = dim(varIn,f) - for ii=1:length(varIn) - varIn{ii} = f*varIn{ii}; - end -end - -function vOut = cmap2linspecer(vIn) % changes the format from a double array to a cell array with the right format -vOut = cell(size(vIn,1),1); -for ii=1:size(vIn,1) - vOut{ii} = vIn(ii,:); -end -end -%% -% colorm returns a colormap which is really good for creating informative -% heatmap style figures. -% No particular color stands out and it doesn't do too badly for colorblind people either. -% It works by interpolating the data from the -% 'spectral' setting on http://colorbrewer2.org/ set to 11 colors -% It is modified a little to make the brightest yellow a little less bright. -function cmap = colorm(varargin) -n = 100; -if ~isempty(varargin) - n = varargin{1}; -end - -if n==1 - cmap = [0.2005 0.5593 0.7380]; - return; -end -if n==2 - cmap = [0.2005 0.5593 0.7380; - 0.9684 0.4799 0.2723]; - return; -end - -frac=.95; % Slight modification from colorbrewer here to make the yellows in the center just a bit darker -cmapp = [158, 1, 66; 213, 62, 79; 244, 109, 67; 253, 174, 97; 254, 224, 139; 255*frac, 255*frac, 191*frac; 230, 245, 152; 171, 221, 164; 102, 194, 165; 50, 136, 189; 94, 79, 162]; -x = linspace(1,n,size(cmapp,1)); -xi = 1:n; -cmap = zeros(n,3); -for ii=1:3 - cmap(:,ii) = pchip(x,cmapp(:,ii),xi); -end -cmap = flipud(cmap/255); -end - -function cmap = whiteFade(varargin) -n = 100; -if nargin>0 - n = varargin{1}; -end - -thisColor = 'blue'; - -if nargin>1 - thisColor = varargin{2}; -end -switch thisColor - case {'gray','grey'} - cmapp = [255,255,255;240,240,240;217,217,217;189,189,189;150,150,150;115,115,115;82,82,82;37,37,37;0,0,0]; - case 'green' - cmapp = [247,252,245;229,245,224;199,233,192;161,217,155;116,196,118;65,171,93;35,139,69;0,109,44;0,68,27]; - case 'blue' - cmapp = [247,251,255;222,235,247;198,219,239;158,202,225;107,174,214;66,146,198;33,113,181;8,81,156;8,48,107]; - case 'red' - cmapp = [255,245,240;254,224,210;252,187,161;252,146,114;251,106,74;239,59,44;203,24,29;165,15,21;103,0,13]; - otherwise - warning(['sorry your color argument ' thisColor ' was not recognized']); -end - -cmap = interpomap(n,cmapp); -end - -% Eat a approximate colormap, then interpolate the rest of it up. -function cmap = interpomap(n,cmapp) - x = linspace(1,n,size(cmapp,1)); - xi = 1:n; - cmap = zeros(n,3); - for ii=1:3 - cmap(:,ii) = pchip(x,cmapp(:,ii),xi); - end - cmap = (cmap/255); % flipud?? -end - - - diff --git a/Functions/helper_functions_community/Violinplot-Matlab-master/LICENSE b/Libs/Violinplot-Matlab-master/LICENSE similarity index 100% rename from Functions/helper_functions_community/Violinplot-Matlab-master/LICENSE rename to Libs/Violinplot-Matlab-master/LICENSE diff --git a/Functions/helper_functions_community/Violinplot-Matlab-master/README.md b/Libs/Violinplot-Matlab-master/README.md similarity index 100% rename from Functions/helper_functions_community/Violinplot-Matlab-master/README.md rename to Libs/Violinplot-Matlab-master/README.md diff --git a/Functions/helper_functions_community/Violinplot-Matlab-master/Violin.m b/Libs/Violinplot-Matlab-master/Violin.m similarity index 100% rename from Functions/helper_functions_community/Violinplot-Matlab-master/Violin.m rename to Libs/Violinplot-Matlab-master/Violin.m diff --git a/Functions/helper_functions_community/Violinplot-Matlab-master/example.png b/Libs/Violinplot-Matlab-master/example.png similarity index 100% rename from Functions/helper_functions_community/Violinplot-Matlab-master/example.png rename to Libs/Violinplot-Matlab-master/example.png diff --git a/Functions/helper_functions_community/Violinplot-Matlab-master/example2.png b/Libs/Violinplot-Matlab-master/example2.png similarity index 100% rename from Functions/helper_functions_community/Violinplot-Matlab-master/example2.png rename to Libs/Violinplot-Matlab-master/example2.png diff --git a/Functions/helper_functions_community/Violinplot-Matlab-master/test_cases/testviolinplot.m b/Libs/Violinplot-Matlab-master/test_cases/testviolinplot.m similarity index 100% rename from Functions/helper_functions_community/Violinplot-Matlab-master/test_cases/testviolinplot.m rename to Libs/Violinplot-Matlab-master/test_cases/testviolinplot.m diff --git a/Functions/helper_functions_community/Violinplot-Matlab-master/violinplot.m b/Libs/Violinplot-Matlab-master/violinplot.m similarity index 100% rename from Functions/helper_functions_community/Violinplot-Matlab-master/violinplot.m rename to Libs/Violinplot-Matlab-master/violinplot.m diff --git a/Functions/helper_functions_community/autoArrangeFigures.m b/Libs/autoArrangeFigures.m similarity index 100% rename from Functions/helper_functions_community/autoArrangeFigures.m rename to Libs/autoArrangeFigures.m diff --git a/Functions/helper_functions_community/boundedlines/.gitignore b/Libs/boundedlines/.gitignore similarity index 100% rename from Functions/helper_functions_community/boundedlines/.gitignore rename to Libs/boundedlines/.gitignore diff --git a/Functions/helper_functions_community/boundedlines/Inpaint_nans/.gitignore b/Libs/boundedlines/Inpaint_nans/.gitignore similarity index 100% rename from Functions/helper_functions_community/boundedlines/Inpaint_nans/.gitignore rename to Libs/boundedlines/Inpaint_nans/.gitignore diff --git a/Functions/helper_functions_community/boundedlines/Inpaint_nans/demo/html/inpaint_nans_demo.html b/Libs/boundedlines/Inpaint_nans/demo/html/inpaint_nans_demo.html similarity index 100% rename from Functions/helper_functions_community/boundedlines/Inpaint_nans/demo/html/inpaint_nans_demo.html rename to Libs/boundedlines/Inpaint_nans/demo/html/inpaint_nans_demo.html diff --git a/Functions/helper_functions_community/boundedlines/Inpaint_nans/demo/html/inpaint_nans_demo.png b/Libs/boundedlines/Inpaint_nans/demo/html/inpaint_nans_demo.png similarity index 100% rename from Functions/helper_functions_community/boundedlines/Inpaint_nans/demo/html/inpaint_nans_demo.png rename to Libs/boundedlines/Inpaint_nans/demo/html/inpaint_nans_demo.png diff --git a/Functions/helper_functions_community/boundedlines/Inpaint_nans/demo/html/inpaint_nans_demo_01.png b/Libs/boundedlines/Inpaint_nans/demo/html/inpaint_nans_demo_01.png similarity index 100% rename from Functions/helper_functions_community/boundedlines/Inpaint_nans/demo/html/inpaint_nans_demo_01.png rename to Libs/boundedlines/Inpaint_nans/demo/html/inpaint_nans_demo_01.png diff --git a/Functions/helper_functions_community/boundedlines/Inpaint_nans/demo/html/inpaint_nans_demo_02.png b/Libs/boundedlines/Inpaint_nans/demo/html/inpaint_nans_demo_02.png similarity index 100% rename from Functions/helper_functions_community/boundedlines/Inpaint_nans/demo/html/inpaint_nans_demo_02.png rename to Libs/boundedlines/Inpaint_nans/demo/html/inpaint_nans_demo_02.png diff --git a/Functions/helper_functions_community/boundedlines/Inpaint_nans/demo/html/inpaint_nans_demo_03.png b/Libs/boundedlines/Inpaint_nans/demo/html/inpaint_nans_demo_03.png similarity index 100% rename from Functions/helper_functions_community/boundedlines/Inpaint_nans/demo/html/inpaint_nans_demo_03.png rename to Libs/boundedlines/Inpaint_nans/demo/html/inpaint_nans_demo_03.png diff --git a/Functions/helper_functions_community/boundedlines/Inpaint_nans/demo/html/inpaint_nans_demo_04.png b/Libs/boundedlines/Inpaint_nans/demo/html/inpaint_nans_demo_04.png similarity index 100% rename from Functions/helper_functions_community/boundedlines/Inpaint_nans/demo/html/inpaint_nans_demo_04.png rename to Libs/boundedlines/Inpaint_nans/demo/html/inpaint_nans_demo_04.png diff --git a/Functions/helper_functions_community/boundedlines/Inpaint_nans/demo/html/inpaint_nans_demo_05.png b/Libs/boundedlines/Inpaint_nans/demo/html/inpaint_nans_demo_05.png similarity index 100% rename from Functions/helper_functions_community/boundedlines/Inpaint_nans/demo/html/inpaint_nans_demo_05.png rename to Libs/boundedlines/Inpaint_nans/demo/html/inpaint_nans_demo_05.png diff --git a/Functions/helper_functions_community/boundedlines/Inpaint_nans/demo/html/inpaint_nans_demo_06.png b/Libs/boundedlines/Inpaint_nans/demo/html/inpaint_nans_demo_06.png similarity index 100% rename from Functions/helper_functions_community/boundedlines/Inpaint_nans/demo/html/inpaint_nans_demo_06.png rename to Libs/boundedlines/Inpaint_nans/demo/html/inpaint_nans_demo_06.png diff --git a/Functions/helper_functions_community/boundedlines/Inpaint_nans/demo/inpaint_nans_demo_old.m b/Libs/boundedlines/Inpaint_nans/demo/inpaint_nans_demo_old.m similarity index 100% rename from Functions/helper_functions_community/boundedlines/Inpaint_nans/demo/inpaint_nans_demo_old.m rename to Libs/boundedlines/Inpaint_nans/demo/inpaint_nans_demo_old.m diff --git a/Functions/helper_functions_community/boundedlines/Inpaint_nans/doc/Nomination comments.rtf b/Libs/boundedlines/Inpaint_nans/doc/Nomination comments.rtf similarity index 100% rename from Functions/helper_functions_community/boundedlines/Inpaint_nans/doc/Nomination comments.rtf rename to Libs/boundedlines/Inpaint_nans/doc/Nomination comments.rtf diff --git a/Functions/helper_functions_community/boundedlines/Inpaint_nans/doc/methods_of_inpaint_nans.m b/Libs/boundedlines/Inpaint_nans/doc/methods_of_inpaint_nans.m similarity index 100% rename from Functions/helper_functions_community/boundedlines/Inpaint_nans/doc/methods_of_inpaint_nans.m rename to Libs/boundedlines/Inpaint_nans/doc/methods_of_inpaint_nans.m diff --git a/Functions/helper_functions_community/boundedlines/Inpaint_nans/garden50.jpg b/Libs/boundedlines/Inpaint_nans/garden50.jpg similarity index 100% rename from Functions/helper_functions_community/boundedlines/Inpaint_nans/garden50.jpg rename to Libs/boundedlines/Inpaint_nans/garden50.jpg diff --git a/Functions/helper_functions_community/boundedlines/Inpaint_nans/inpaint_nans.m b/Libs/boundedlines/Inpaint_nans/inpaint_nans.m similarity index 100% rename from Functions/helper_functions_community/boundedlines/Inpaint_nans/inpaint_nans.m rename to Libs/boundedlines/Inpaint_nans/inpaint_nans.m diff --git a/Functions/helper_functions_community/boundedlines/Inpaint_nans/inpaint_nans_bc.m b/Libs/boundedlines/Inpaint_nans/inpaint_nans_bc.m similarity index 100% rename from Functions/helper_functions_community/boundedlines/Inpaint_nans/inpaint_nans_bc.m rename to Libs/boundedlines/Inpaint_nans/inpaint_nans_bc.m diff --git a/Functions/helper_functions_community/boundedlines/Inpaint_nans/inpaint_nans_demo.m b/Libs/boundedlines/Inpaint_nans/inpaint_nans_demo.m similarity index 100% rename from Functions/helper_functions_community/boundedlines/Inpaint_nans/inpaint_nans_demo.m rename to Libs/boundedlines/Inpaint_nans/inpaint_nans_demo.m diff --git a/Functions/helper_functions_community/boundedlines/Inpaint_nans/license.txt b/Libs/boundedlines/Inpaint_nans/license.txt similarity index 100% rename from Functions/helper_functions_community/boundedlines/Inpaint_nans/license.txt rename to Libs/boundedlines/Inpaint_nans/license.txt diff --git a/Functions/helper_functions_community/boundedlines/Inpaint_nans/monet_adresse.jpg b/Libs/boundedlines/Inpaint_nans/monet_adresse.jpg similarity index 100% rename from Functions/helper_functions_community/boundedlines/Inpaint_nans/monet_adresse.jpg rename to Libs/boundedlines/Inpaint_nans/monet_adresse.jpg diff --git a/Functions/helper_functions_community/boundedlines/Inpaint_nans/test/test_main.m b/Libs/boundedlines/Inpaint_nans/test/test_main.m similarity index 100% rename from Functions/helper_functions_community/boundedlines/Inpaint_nans/test/test_main.m rename to Libs/boundedlines/Inpaint_nans/test/test_main.m diff --git a/Functions/helper_functions_community/boundedlines/LICENSE.txt b/Libs/boundedlines/LICENSE.txt similarity index 100% rename from Functions/helper_functions_community/boundedlines/LICENSE.txt rename to Libs/boundedlines/LICENSE.txt diff --git a/Functions/helper_functions_community/boundedlines/README.html b/Libs/boundedlines/README.html similarity index 100% rename from Functions/helper_functions_community/boundedlines/README.html rename to Libs/boundedlines/README.html diff --git a/Functions/helper_functions_community/boundedlines/README.m b/Libs/boundedlines/README.m similarity index 100% rename from Functions/helper_functions_community/boundedlines/README.m rename to Libs/boundedlines/README.m diff --git a/Functions/helper_functions_community/boundedlines/README.md b/Libs/boundedlines/README.md similarity index 100% rename from Functions/helper_functions_community/boundedlines/README.md rename to Libs/boundedlines/README.md diff --git a/Functions/helper_functions_community/boundedlines/boundedline/.gitignore b/Libs/boundedlines/boundedline/.gitignore similarity index 100% rename from Functions/helper_functions_community/boundedlines/boundedline/.gitignore rename to Libs/boundedlines/boundedline/.gitignore diff --git a/Functions/helper_functions_community/boundedlines/boundedline/boundedline.m b/Libs/boundedlines/boundedline/boundedline.m similarity index 100% rename from Functions/helper_functions_community/boundedlines/boundedline/boundedline.m rename to Libs/boundedlines/boundedline/boundedline.m diff --git a/Functions/helper_functions_community/boundedlines/boundedline/outlinebounds.m b/Libs/boundedlines/boundedline/outlinebounds.m similarity index 100% rename from Functions/helper_functions_community/boundedlines/boundedline/outlinebounds.m rename to Libs/boundedlines/boundedline/outlinebounds.m diff --git a/Functions/helper_functions_community/boundedlines/catuneven/.gitignore b/Libs/boundedlines/catuneven/.gitignore similarity index 100% rename from Functions/helper_functions_community/boundedlines/catuneven/.gitignore rename to Libs/boundedlines/catuneven/.gitignore diff --git a/Functions/helper_functions_community/boundedlines/catuneven/catuneven.m b/Libs/boundedlines/catuneven/catuneven.m similarity index 100% rename from Functions/helper_functions_community/boundedlines/catuneven/catuneven.m rename to Libs/boundedlines/catuneven/catuneven.m diff --git a/Functions/helper_functions_community/boundedlines/readmeExtras/README_01.png b/Libs/boundedlines/readmeExtras/README_01.png similarity index 100% rename from Functions/helper_functions_community/boundedlines/readmeExtras/README_01.png rename to Libs/boundedlines/readmeExtras/README_01.png diff --git a/Functions/helper_functions_community/boundedlines/readmeExtras/README_02.png b/Libs/boundedlines/readmeExtras/README_02.png similarity index 100% rename from Functions/helper_functions_community/boundedlines/readmeExtras/README_02.png rename to Libs/boundedlines/readmeExtras/README_02.png diff --git a/Functions/helper_functions_community/boundedlines/readmeExtras/README_03.png b/Libs/boundedlines/readmeExtras/README_03.png similarity index 100% rename from Functions/helper_functions_community/boundedlines/readmeExtras/README_03.png rename to Libs/boundedlines/readmeExtras/README_03.png diff --git a/Functions/helper_functions_community/boundedlines/readmeExtras/README_04.png b/Libs/boundedlines/readmeExtras/README_04.png similarity index 100% rename from Functions/helper_functions_community/boundedlines/readmeExtras/README_04.png rename to Libs/boundedlines/readmeExtras/README_04.png diff --git a/Functions/helper_functions_community/boundedlines/readmeExtras/README_05.png b/Libs/boundedlines/readmeExtras/README_05.png similarity index 100% rename from Functions/helper_functions_community/boundedlines/readmeExtras/README_05.png rename to Libs/boundedlines/readmeExtras/README_05.png diff --git a/Functions/helper_functions_community/boundedlines/readmeExtras/README_06.png b/Libs/boundedlines/readmeExtras/README_06.png similarity index 100% rename from Functions/helper_functions_community/boundedlines/readmeExtras/README_06.png rename to Libs/boundedlines/readmeExtras/README_06.png diff --git a/Functions/helper_functions_community/boundedlines/readmeExtras/README_07.png b/Libs/boundedlines/readmeExtras/README_07.png similarity index 100% rename from Functions/helper_functions_community/boundedlines/readmeExtras/README_07.png rename to Libs/boundedlines/readmeExtras/README_07.png diff --git a/Functions/helper_functions_community/boundedlines/readmeExtras/README_08.png b/Libs/boundedlines/readmeExtras/README_08.png similarity index 100% rename from Functions/helper_functions_community/boundedlines/readmeExtras/README_08.png rename to Libs/boundedlines/readmeExtras/README_08.png diff --git a/Functions/helper_functions_community/boundedlines/singlepatch/.gitignore b/Libs/boundedlines/singlepatch/.gitignore similarity index 100% rename from Functions/helper_functions_community/boundedlines/singlepatch/.gitignore rename to Libs/boundedlines/singlepatch/.gitignore diff --git a/Functions/helper_functions_community/boundedlines/singlepatch/singlepatch.m b/Libs/boundedlines/singlepatch/singlepatch.m similarity index 100% rename from Functions/helper_functions_community/boundedlines/singlepatch/singlepatch.m rename to Libs/boundedlines/singlepatch/singlepatch.m diff --git a/Functions/helper_functions_community/colorspace/colorspace.c b/Libs/colorspace/colorspace.c similarity index 100% rename from Functions/helper_functions_community/colorspace/colorspace.c rename to Libs/colorspace/colorspace.c diff --git a/Functions/helper_functions_community/colorspace/colorspace.h b/Libs/colorspace/colorspace.h similarity index 100% rename from Functions/helper_functions_community/colorspace/colorspace.h rename to Libs/colorspace/colorspace.h diff --git a/Functions/helper_functions_community/colorspace/colorspace.m b/Libs/colorspace/colorspace.m similarity index 100% rename from Functions/helper_functions_community/colorspace/colorspace.m rename to Libs/colorspace/colorspace.m diff --git a/Functions/helper_functions_community/mat2tikz/.gitignore b/Libs/mat2tikz/.gitignore similarity index 100% rename from Functions/helper_functions_community/mat2tikz/.gitignore rename to Libs/mat2tikz/.gitignore diff --git a/Functions/helper_functions_community/mat2tikz/.travis.yml b/Libs/mat2tikz/.travis.yml similarity index 100% rename from Functions/helper_functions_community/mat2tikz/.travis.yml rename to Libs/mat2tikz/.travis.yml diff --git a/Functions/helper_functions_community/mat2tikz/AUTHORS.md b/Libs/mat2tikz/AUTHORS.md similarity index 100% rename from Functions/helper_functions_community/mat2tikz/AUTHORS.md rename to Libs/mat2tikz/AUTHORS.md diff --git a/Functions/helper_functions_community/mat2tikz/CHANGELOG.md b/Libs/mat2tikz/CHANGELOG.md similarity index 100% rename from Functions/helper_functions_community/mat2tikz/CHANGELOG.md rename to Libs/mat2tikz/CHANGELOG.md diff --git a/Functions/helper_functions_community/mat2tikz/CONTRIBUTING.md b/Libs/mat2tikz/CONTRIBUTING.md similarity index 100% rename from Functions/helper_functions_community/mat2tikz/CONTRIBUTING.md rename to Libs/mat2tikz/CONTRIBUTING.md diff --git a/Functions/helper_functions_community/mat2tikz/LICENSE.md b/Libs/mat2tikz/LICENSE.md similarity index 100% rename from Functions/helper_functions_community/mat2tikz/LICENSE.md rename to Libs/mat2tikz/LICENSE.md diff --git a/Functions/helper_functions_community/mat2tikz/README.md b/Libs/mat2tikz/README.md similarity index 100% rename from Functions/helper_functions_community/mat2tikz/README.md rename to Libs/mat2tikz/README.md diff --git a/Functions/helper_functions_community/mat2tikz/logos/matlab2tikz.svg b/Libs/mat2tikz/logos/matlab2tikz.svg similarity index 100% rename from Functions/helper_functions_community/mat2tikz/logos/matlab2tikz.svg rename to Libs/mat2tikz/logos/matlab2tikz.svg diff --git a/Functions/helper_functions_community/mat2tikz/matlab2tikz.sublime-project b/Libs/mat2tikz/matlab2tikz.sublime-project similarity index 100% rename from Functions/helper_functions_community/mat2tikz/matlab2tikz.sublime-project rename to Libs/mat2tikz/matlab2tikz.sublime-project diff --git a/Functions/helper_functions_community/mat2tikz/runtests.sh b/Libs/mat2tikz/runtests.sh similarity index 100% rename from Functions/helper_functions_community/mat2tikz/runtests.sh rename to Libs/mat2tikz/runtests.sh diff --git a/Functions/helper_functions_community/mat2tikz/src/cleanfigure.m b/Libs/mat2tikz/src/cleanfigure.m similarity index 100% rename from Functions/helper_functions_community/mat2tikz/src/cleanfigure.m rename to Libs/mat2tikz/src/cleanfigure.m diff --git a/Functions/helper_functions_community/mat2tikz/src/dev/formatWhitespace.m b/Libs/mat2tikz/src/dev/formatWhitespace.m similarity index 100% rename from Functions/helper_functions_community/mat2tikz/src/dev/formatWhitespace.m rename to Libs/mat2tikz/src/dev/formatWhitespace.m diff --git a/Functions/helper_functions_community/mat2tikz/src/figure2dot.m b/Libs/mat2tikz/src/figure2dot.m similarity index 100% rename from Functions/helper_functions_community/mat2tikz/src/figure2dot.m rename to Libs/mat2tikz/src/figure2dot.m diff --git a/Functions/helper_functions_community/mat2tikz/src/m2tInputParser.m b/Libs/mat2tikz/src/m2tInputParser.m similarity index 100% rename from Functions/helper_functions_community/mat2tikz/src/m2tInputParser.m rename to Libs/mat2tikz/src/m2tInputParser.m diff --git a/Functions/helper_functions_community/mat2tikz/src/m2tcustom.m b/Libs/mat2tikz/src/m2tcustom.m similarity index 100% rename from Functions/helper_functions_community/mat2tikz/src/m2tcustom.m rename to Libs/mat2tikz/src/m2tcustom.m diff --git a/Functions/helper_functions_community/mat2tikz/src/matlab2tikz.m b/Libs/mat2tikz/src/matlab2tikz.m similarity index 100% rename from Functions/helper_functions_community/mat2tikz/src/matlab2tikz.m rename to Libs/mat2tikz/src/matlab2tikz.m diff --git a/Functions/helper_functions_community/mat2tikz/src/private/errorUnknownEnvironment.m b/Libs/mat2tikz/src/private/errorUnknownEnvironment.m similarity index 100% rename from Functions/helper_functions_community/mat2tikz/src/private/errorUnknownEnvironment.m rename to Libs/mat2tikz/src/private/errorUnknownEnvironment.m diff --git a/Functions/helper_functions_community/mat2tikz/src/private/getEnvironment.m b/Libs/mat2tikz/src/private/getEnvironment.m similarity index 100% rename from Functions/helper_functions_community/mat2tikz/src/private/getEnvironment.m rename to Libs/mat2tikz/src/private/getEnvironment.m diff --git a/Functions/helper_functions_community/mat2tikz/src/private/guitypes.m b/Libs/mat2tikz/src/private/guitypes.m similarity index 100% rename from Functions/helper_functions_community/mat2tikz/src/private/guitypes.m rename to Libs/mat2tikz/src/private/guitypes.m diff --git a/Functions/helper_functions_community/mat2tikz/src/private/isAxis3D.m b/Libs/mat2tikz/src/private/isAxis3D.m similarity index 100% rename from Functions/helper_functions_community/mat2tikz/src/private/isAxis3D.m rename to Libs/mat2tikz/src/private/isAxis3D.m diff --git a/Functions/helper_functions_community/mat2tikz/src/private/isVersionBelow.m b/Libs/mat2tikz/src/private/isVersionBelow.m similarity index 100% rename from Functions/helper_functions_community/mat2tikz/src/private/isVersionBelow.m rename to Libs/mat2tikz/src/private/isVersionBelow.m diff --git a/Functions/helper_functions_community/mat2tikz/src/private/m2tUpdater.m b/Libs/mat2tikz/src/private/m2tUpdater.m similarity index 100% rename from Functions/helper_functions_community/mat2tikz/src/private/m2tUpdater.m rename to Libs/mat2tikz/src/private/m2tUpdater.m diff --git a/Functions/helper_functions_community/mat2tikz/src/private/m2tstrjoin.m b/Libs/mat2tikz/src/private/m2tstrjoin.m similarity index 100% rename from Functions/helper_functions_community/mat2tikz/src/private/m2tstrjoin.m rename to Libs/mat2tikz/src/private/m2tstrjoin.m diff --git a/Functions/helper_functions_community/mat2tikz/src/private/versionArray.m b/Libs/mat2tikz/src/private/versionArray.m similarity index 100% rename from Functions/helper_functions_community/mat2tikz/src/private/versionArray.m rename to Libs/mat2tikz/src/private/versionArray.m diff --git a/Functions/helper_functions_community/mat2tikz/src/private/versionString.m b/Libs/mat2tikz/src/private/versionString.m similarity index 100% rename from Functions/helper_functions_community/mat2tikz/src/private/versionString.m rename to Libs/mat2tikz/src/private/versionString.m diff --git a/Functions/helper_functions_community/mat2tikz/test/README.md b/Libs/mat2tikz/test/README.md similarity index 100% rename from Functions/helper_functions_community/mat2tikz/test/README.md rename to Libs/mat2tikz/test/README.md diff --git a/Functions/helper_functions_community/mat2tikz/test/codeReport.m b/Libs/mat2tikz/test/codeReport.m similarity index 100% rename from Functions/helper_functions_community/mat2tikz/test/codeReport.m rename to Libs/mat2tikz/test/codeReport.m diff --git a/Functions/helper_functions_community/mat2tikz/test/compareTimings.m b/Libs/mat2tikz/test/compareTimings.m similarity index 100% rename from Functions/helper_functions_community/mat2tikz/test/compareTimings.m rename to Libs/mat2tikz/test/compareTimings.m diff --git a/Functions/helper_functions_community/mat2tikz/test/examples/example_bar_plot.m b/Libs/mat2tikz/test/examples/example_bar_plot.m similarity index 100% rename from Functions/helper_functions_community/mat2tikz/test/examples/example_bar_plot.m rename to Libs/mat2tikz/test/examples/example_bar_plot.m diff --git a/Functions/helper_functions_community/mat2tikz/test/examples/example_quivers.m b/Libs/mat2tikz/test/examples/example_quivers.m similarity index 100% rename from Functions/helper_functions_community/mat2tikz/test/examples/example_quivers.m rename to Libs/mat2tikz/test/examples/example_quivers.m diff --git a/Functions/helper_functions_community/mat2tikz/test/makeLatexReport.m b/Libs/mat2tikz/test/makeLatexReport.m similarity index 100% rename from Functions/helper_functions_community/mat2tikz/test/makeLatexReport.m rename to Libs/mat2tikz/test/makeLatexReport.m diff --git a/Functions/helper_functions_community/mat2tikz/test/makeTapReport.m b/Libs/mat2tikz/test/makeTapReport.m similarity index 100% rename from Functions/helper_functions_community/mat2tikz/test/makeTapReport.m rename to Libs/mat2tikz/test/makeTapReport.m diff --git a/Functions/helper_functions_community/mat2tikz/test/makeTravisReport.m b/Libs/mat2tikz/test/makeTravisReport.m similarity index 100% rename from Functions/helper_functions_community/mat2tikz/test/makeTravisReport.m rename to Libs/mat2tikz/test/makeTravisReport.m diff --git a/Functions/helper_functions_community/mat2tikz/test/output/.gitignore b/Libs/mat2tikz/test/output/.gitignore similarity index 100% rename from Functions/helper_functions_community/mat2tikz/test/output/.gitignore rename to Libs/mat2tikz/test/output/.gitignore diff --git a/Functions/helper_functions_community/mat2tikz/test/private/OSVersion.m b/Libs/mat2tikz/test/private/OSVersion.m similarity index 100% rename from Functions/helper_functions_community/mat2tikz/test/private/OSVersion.m rename to Libs/mat2tikz/test/private/OSVersion.m diff --git a/Functions/helper_functions_community/mat2tikz/test/private/StreamMaker.m b/Libs/mat2tikz/test/private/StreamMaker.m similarity index 100% rename from Functions/helper_functions_community/mat2tikz/test/private/StreamMaker.m rename to Libs/mat2tikz/test/private/StreamMaker.m diff --git a/Functions/helper_functions_community/mat2tikz/test/private/VersionControlIdentifier.m b/Libs/mat2tikz/test/private/VersionControlIdentifier.m similarity index 100% rename from Functions/helper_functions_community/mat2tikz/test/private/VersionControlIdentifier.m rename to Libs/mat2tikz/test/private/VersionControlIdentifier.m diff --git a/Functions/helper_functions_community/mat2tikz/test/private/calculateMD5Hash.m b/Libs/mat2tikz/test/private/calculateMD5Hash.m similarity index 100% rename from Functions/helper_functions_community/mat2tikz/test/private/calculateMD5Hash.m rename to Libs/mat2tikz/test/private/calculateMD5Hash.m diff --git a/Functions/helper_functions_community/mat2tikz/test/private/cleanFiles.m b/Libs/mat2tikz/test/private/cleanFiles.m similarity index 100% rename from Functions/helper_functions_community/mat2tikz/test/private/cleanFiles.m rename to Libs/mat2tikz/test/private/cleanFiles.m diff --git a/Functions/helper_functions_community/mat2tikz/test/private/countNumberOfErrors.m b/Libs/mat2tikz/test/private/countNumberOfErrors.m similarity index 100% rename from Functions/helper_functions_community/mat2tikz/test/private/countNumberOfErrors.m rename to Libs/mat2tikz/test/private/countNumberOfErrors.m diff --git a/Functions/helper_functions_community/mat2tikz/test/private/emptyStage.m b/Libs/mat2tikz/test/private/emptyStage.m similarity index 100% rename from Functions/helper_functions_community/mat2tikz/test/private/emptyStage.m rename to Libs/mat2tikz/test/private/emptyStage.m diff --git a/Functions/helper_functions_community/mat2tikz/test/private/emptyStatus.m b/Libs/mat2tikz/test/private/emptyStatus.m similarity index 100% rename from Functions/helper_functions_community/mat2tikz/test/private/emptyStatus.m rename to Libs/mat2tikz/test/private/emptyStatus.m diff --git a/Functions/helper_functions_community/mat2tikz/test/private/errorHandler.m b/Libs/mat2tikz/test/private/errorHandler.m similarity index 100% rename from Functions/helper_functions_community/mat2tikz/test/private/errorHandler.m rename to Libs/mat2tikz/test/private/errorHandler.m diff --git a/Functions/helper_functions_community/mat2tikz/test/private/errorHasOccurred.m b/Libs/mat2tikz/test/private/errorHasOccurred.m similarity index 100% rename from Functions/helper_functions_community/mat2tikz/test/private/errorHasOccurred.m rename to Libs/mat2tikz/test/private/errorHasOccurred.m diff --git a/Functions/helper_functions_community/mat2tikz/test/private/execute_hash_stage.m b/Libs/mat2tikz/test/private/execute_hash_stage.m similarity index 100% rename from Functions/helper_functions_community/mat2tikz/test/private/execute_hash_stage.m rename to Libs/mat2tikz/test/private/execute_hash_stage.m diff --git a/Functions/helper_functions_community/mat2tikz/test/private/execute_plot_stage.m b/Libs/mat2tikz/test/private/execute_plot_stage.m similarity index 100% rename from Functions/helper_functions_community/mat2tikz/test/private/execute_plot_stage.m rename to Libs/mat2tikz/test/private/execute_plot_stage.m diff --git a/Functions/helper_functions_community/mat2tikz/test/private/execute_save_stage.m b/Libs/mat2tikz/test/private/execute_save_stage.m similarity index 100% rename from Functions/helper_functions_community/mat2tikz/test/private/execute_save_stage.m rename to Libs/mat2tikz/test/private/execute_save_stage.m diff --git a/Functions/helper_functions_community/mat2tikz/test/private/execute_tikz_stage.m b/Libs/mat2tikz/test/private/execute_tikz_stage.m similarity index 100% rename from Functions/helper_functions_community/mat2tikz/test/private/execute_tikz_stage.m rename to Libs/mat2tikz/test/private/execute_tikz_stage.m diff --git a/Functions/helper_functions_community/mat2tikz/test/private/execute_type_stage.m b/Libs/mat2tikz/test/private/execute_type_stage.m similarity index 100% rename from Functions/helper_functions_community/mat2tikz/test/private/execute_type_stage.m rename to Libs/mat2tikz/test/private/execute_type_stage.m diff --git a/Functions/helper_functions_community/mat2tikz/test/private/fillStruct.m b/Libs/mat2tikz/test/private/fillStruct.m similarity index 100% rename from Functions/helper_functions_community/mat2tikz/test/private/fillStruct.m rename to Libs/mat2tikz/test/private/fillStruct.m diff --git a/Functions/helper_functions_community/mat2tikz/test/private/getEnvironment.m b/Libs/mat2tikz/test/private/getEnvironment.m similarity index 100% rename from Functions/helper_functions_community/mat2tikz/test/private/getEnvironment.m rename to Libs/mat2tikz/test/private/getEnvironment.m diff --git a/Functions/helper_functions_community/mat2tikz/test/private/getStagesFromStatus.m b/Libs/mat2tikz/test/private/getStagesFromStatus.m similarity index 100% rename from Functions/helper_functions_community/mat2tikz/test/private/getStagesFromStatus.m rename to Libs/mat2tikz/test/private/getStagesFromStatus.m diff --git a/Functions/helper_functions_community/mat2tikz/test/private/hasTestFailed.m b/Libs/mat2tikz/test/private/hasTestFailed.m similarity index 100% rename from Functions/helper_functions_community/mat2tikz/test/private/hasTestFailed.m rename to Libs/mat2tikz/test/private/hasTestFailed.m diff --git a/Functions/helper_functions_community/mat2tikz/test/private/hashTableName.m b/Libs/mat2tikz/test/private/hashTableName.m similarity index 100% rename from Functions/helper_functions_community/mat2tikz/test/private/hashTableName.m rename to Libs/mat2tikz/test/private/hashTableName.m diff --git a/Functions/helper_functions_community/mat2tikz/test/private/initializeGlobalState.m b/Libs/mat2tikz/test/private/initializeGlobalState.m similarity index 100% rename from Functions/helper_functions_community/mat2tikz/test/private/initializeGlobalState.m rename to Libs/mat2tikz/test/private/initializeGlobalState.m diff --git a/Functions/helper_functions_community/mat2tikz/test/private/loadHashTable.m b/Libs/mat2tikz/test/private/loadHashTable.m similarity index 100% rename from Functions/helper_functions_community/mat2tikz/test/private/loadHashTable.m rename to Libs/mat2tikz/test/private/loadHashTable.m diff --git a/Functions/helper_functions_community/mat2tikz/test/private/m2troot.m b/Libs/mat2tikz/test/private/m2troot.m similarity index 100% rename from Functions/helper_functions_community/mat2tikz/test/private/m2troot.m rename to Libs/mat2tikz/test/private/m2troot.m diff --git a/Functions/helper_functions_community/mat2tikz/test/private/m2tstrjoin.m b/Libs/mat2tikz/test/private/m2tstrjoin.m similarity index 100% rename from Functions/helper_functions_community/mat2tikz/test/private/m2tstrjoin.m rename to Libs/mat2tikz/test/private/m2tstrjoin.m diff --git a/Functions/helper_functions_community/mat2tikz/test/private/restoreGlobalState.m b/Libs/mat2tikz/test/private/restoreGlobalState.m similarity index 100% rename from Functions/helper_functions_community/mat2tikz/test/private/restoreGlobalState.m rename to Libs/mat2tikz/test/private/restoreGlobalState.m diff --git a/Functions/helper_functions_community/mat2tikz/test/private/splitPassFailSkippedTests.m b/Libs/mat2tikz/test/private/splitPassFailSkippedTests.m similarity index 100% rename from Functions/helper_functions_community/mat2tikz/test/private/splitPassFailSkippedTests.m rename to Libs/mat2tikz/test/private/splitPassFailSkippedTests.m diff --git a/Functions/helper_functions_community/mat2tikz/test/private/splitUnreliableTests.m b/Libs/mat2tikz/test/private/splitUnreliableTests.m similarity index 100% rename from Functions/helper_functions_community/mat2tikz/test/private/splitUnreliableTests.m rename to Libs/mat2tikz/test/private/splitUnreliableTests.m diff --git a/Functions/helper_functions_community/mat2tikz/test/private/testMatlab2tikz.m b/Libs/mat2tikz/test/private/testMatlab2tikz.m similarity index 100% rename from Functions/helper_functions_community/mat2tikz/test/private/testMatlab2tikz.m rename to Libs/mat2tikz/test/private/testMatlab2tikz.m diff --git a/Functions/helper_functions_community/mat2tikz/test/runMatlab2TikzTests.m b/Libs/mat2tikz/test/runMatlab2TikzTests.m similarity index 100% rename from Functions/helper_functions_community/mat2tikz/test/runMatlab2TikzTests.m rename to Libs/mat2tikz/test/runMatlab2TikzTests.m diff --git a/Functions/helper_functions_community/mat2tikz/test/saveHashTable.m b/Libs/mat2tikz/test/saveHashTable.m similarity index 100% rename from Functions/helper_functions_community/mat2tikz/test/saveHashTable.m rename to Libs/mat2tikz/test/saveHashTable.m diff --git a/Functions/helper_functions_community/mat2tikz/test/suites/ACID.MATLAB.8.3.md5 b/Libs/mat2tikz/test/suites/ACID.MATLAB.8.3.md5 similarity index 100% rename from Functions/helper_functions_community/mat2tikz/test/suites/ACID.MATLAB.8.3.md5 rename to Libs/mat2tikz/test/suites/ACID.MATLAB.8.3.md5 diff --git a/Functions/helper_functions_community/mat2tikz/test/suites/ACID.MATLAB.8.4.md5 b/Libs/mat2tikz/test/suites/ACID.MATLAB.8.4.md5 similarity index 100% rename from Functions/helper_functions_community/mat2tikz/test/suites/ACID.MATLAB.8.4.md5 rename to Libs/mat2tikz/test/suites/ACID.MATLAB.8.4.md5 diff --git a/Functions/helper_functions_community/mat2tikz/test/suites/ACID.Octave.3.8.0.md5 b/Libs/mat2tikz/test/suites/ACID.Octave.3.8.0.md5 similarity index 100% rename from Functions/helper_functions_community/mat2tikz/test/suites/ACID.Octave.3.8.0.md5 rename to Libs/mat2tikz/test/suites/ACID.Octave.3.8.0.md5 diff --git a/Functions/helper_functions_community/mat2tikz/test/suites/ACID.Octave.4.2.0.md5 b/Libs/mat2tikz/test/suites/ACID.Octave.4.2.0.md5 similarity index 100% rename from Functions/helper_functions_community/mat2tikz/test/suites/ACID.Octave.4.2.0.md5 rename to Libs/mat2tikz/test/suites/ACID.Octave.4.2.0.md5 diff --git a/Functions/helper_functions_community/mat2tikz/test/suites/ACID.Octave.4.2.2.md5 b/Libs/mat2tikz/test/suites/ACID.Octave.4.2.2.md5 similarity index 100% rename from Functions/helper_functions_community/mat2tikz/test/suites/ACID.Octave.4.2.2.md5 rename to Libs/mat2tikz/test/suites/ACID.Octave.4.2.2.md5 diff --git a/Functions/helper_functions_community/mat2tikz/test/suites/ACID.m b/Libs/mat2tikz/test/suites/ACID.m similarity index 100% rename from Functions/helper_functions_community/mat2tikz/test/suites/ACID.m rename to Libs/mat2tikz/test/suites/ACID.m diff --git a/Functions/helper_functions_community/mat2tikz/test/suites/issues.m b/Libs/mat2tikz/test/suites/issues.m similarity index 100% rename from Functions/helper_functions_community/mat2tikz/test/suites/issues.m rename to Libs/mat2tikz/test/suites/issues.m diff --git a/Functions/helper_functions_community/mat2tikz/test/suites/private/getEnvironment.m b/Libs/mat2tikz/test/suites/private/getEnvironment.m similarity index 100% rename from Functions/helper_functions_community/mat2tikz/test/suites/private/getEnvironment.m rename to Libs/mat2tikz/test/suites/private/getEnvironment.m diff --git a/Functions/helper_functions_community/mat2tikz/test/suites/private/herrorbar.m b/Libs/mat2tikz/test/suites/private/herrorbar.m similarity index 100% rename from Functions/helper_functions_community/mat2tikz/test/suites/private/herrorbar.m rename to Libs/mat2tikz/test/suites/private/herrorbar.m diff --git a/Functions/helper_functions_community/mat2tikz/test/suites/private/isEnvironment.m b/Libs/mat2tikz/test/suites/private/isEnvironment.m similarity index 100% rename from Functions/helper_functions_community/mat2tikz/test/suites/private/isEnvironment.m rename to Libs/mat2tikz/test/suites/private/isEnvironment.m diff --git a/Functions/helper_functions_community/mat2tikz/test/suites/private/isMATLAB.m b/Libs/mat2tikz/test/suites/private/isMATLAB.m similarity index 100% rename from Functions/helper_functions_community/mat2tikz/test/suites/private/isMATLAB.m rename to Libs/mat2tikz/test/suites/private/isMATLAB.m diff --git a/Functions/helper_functions_community/mat2tikz/test/suites/private/isOctave.m b/Libs/mat2tikz/test/suites/private/isOctave.m similarity index 100% rename from Functions/helper_functions_community/mat2tikz/test/suites/private/isOctave.m rename to Libs/mat2tikz/test/suites/private/isOctave.m diff --git a/Functions/helper_functions_community/mat2tikz/test/suites/private/isVersionBelow.m b/Libs/mat2tikz/test/suites/private/isVersionBelow.m similarity index 100% rename from Functions/helper_functions_community/mat2tikz/test/suites/private/isVersionBelow.m rename to Libs/mat2tikz/test/suites/private/isVersionBelow.m diff --git a/Functions/helper_functions_community/mat2tikz/test/suites/private/versionCompare.m b/Libs/mat2tikz/test/suites/private/versionCompare.m similarity index 100% rename from Functions/helper_functions_community/mat2tikz/test/suites/private/versionCompare.m rename to Libs/mat2tikz/test/suites/private/versionCompare.m diff --git a/Functions/helper_functions_community/mat2tikz/test/suites/testPatches.m b/Libs/mat2tikz/test/suites/testPatches.m similarity index 100% rename from Functions/helper_functions_community/mat2tikz/test/suites/testPatches.m rename to Libs/mat2tikz/test/suites/testPatches.m diff --git a/Functions/helper_functions_community/mat2tikz/test/suites/testSurfshader.m b/Libs/mat2tikz/test/suites/testSurfshader.m similarity index 100% rename from Functions/helper_functions_community/mat2tikz/test/suites/testSurfshader.m rename to Libs/mat2tikz/test/suites/testSurfshader.m diff --git a/Functions/helper_functions_community/mat2tikz/test/template/.gitignore b/Libs/mat2tikz/test/template/.gitignore similarity index 100% rename from Functions/helper_functions_community/mat2tikz/test/template/.gitignore rename to Libs/mat2tikz/test/template/.gitignore diff --git a/Functions/helper_functions_community/mat2tikz/test/template/Makefile b/Libs/mat2tikz/test/template/Makefile similarity index 100% rename from Functions/helper_functions_community/mat2tikz/test/template/Makefile rename to Libs/mat2tikz/test/template/Makefile diff --git a/Functions/helper_functions_community/mat2tikz/test/template/data/.gitignore b/Libs/mat2tikz/test/template/data/.gitignore similarity index 100% rename from Functions/helper_functions_community/mat2tikz/test/template/data/.gitignore rename to Libs/mat2tikz/test/template/data/.gitignore diff --git a/Functions/helper_functions_community/mat2tikz/test/template/data/converted/Makefile b/Libs/mat2tikz/test/template/data/converted/Makefile similarity index 100% rename from Functions/helper_functions_community/mat2tikz/test/template/data/converted/Makefile rename to Libs/mat2tikz/test/template/data/converted/Makefile diff --git a/Functions/helper_functions_community/mat2tikz/test/template/data/reference/Makefile b/Libs/mat2tikz/test/template/data/reference/Makefile similarity index 100% rename from Functions/helper_functions_community/mat2tikz/test/template/data/reference/Makefile rename to Libs/mat2tikz/test/template/data/reference/Makefile diff --git a/Functions/helper_functions_community/mat2tikz/test/testGraphical.m b/Libs/mat2tikz/test/testGraphical.m similarity index 100% rename from Functions/helper_functions_community/mat2tikz/test/testGraphical.m rename to Libs/mat2tikz/test/testGraphical.m diff --git a/Functions/helper_functions_community/mat2tikz/test/testHeadless.m b/Libs/mat2tikz/test/testHeadless.m similarity index 100% rename from Functions/helper_functions_community/mat2tikz/test/testHeadless.m rename to Libs/mat2tikz/test/testHeadless.m diff --git a/Functions/helper_functions_community/png/nt_.png b/Libs/png/nt_.png similarity index 100% rename from Functions/helper_functions_community/png/nt_.png rename to Libs/png/nt_.png diff --git a/Functions/helper_functions_community/schemer/.gitattributes b/Libs/schemer/.gitattributes similarity index 100% rename from Functions/helper_functions_community/schemer/.gitattributes rename to Libs/schemer/.gitattributes diff --git a/Functions/helper_functions_community/schemer/.gitignore b/Libs/schemer/.gitignore similarity index 100% rename from Functions/helper_functions_community/schemer/.gitignore rename to Libs/schemer/.gitignore diff --git a/Functions/helper_functions_community/schemer/CONTRIBUTING.md b/Libs/schemer/CONTRIBUTING.md similarity index 100% rename from Functions/helper_functions_community/schemer/CONTRIBUTING.md rename to Libs/schemer/CONTRIBUTING.md diff --git a/Functions/helper_functions_community/schemer/LICENSE b/Libs/schemer/LICENSE similarity index 100% rename from Functions/helper_functions_community/schemer/LICENSE rename to Libs/schemer/LICENSE diff --git a/Functions/helper_functions_community/schemer/README.md b/Libs/schemer/README.md similarity index 100% rename from Functions/helper_functions_community/schemer/README.md rename to Libs/schemer/README.md diff --git a/Functions/helper_functions_community/schemer/develop/RGBint2hex.m b/Libs/schemer/develop/RGBint2hex.m similarity index 100% rename from Functions/helper_functions_community/schemer/develop/RGBint2hex.m rename to Libs/schemer/develop/RGBint2hex.m diff --git a/Functions/helper_functions_community/schemer/develop/annotated_default.png b/Libs/schemer/develop/annotated_default.png similarity index 100% rename from Functions/helper_functions_community/schemer/develop/annotated_default.png rename to Libs/schemer/develop/annotated_default.png diff --git a/Functions/helper_functions_community/schemer/develop/color2javaRGBint.m b/Libs/schemer/develop/color2javaRGBint.m similarity index 100% rename from Functions/helper_functions_community/schemer/develop/color2javaRGBint.m rename to Libs/schemer/develop/color2javaRGBint.m diff --git a/Functions/helper_functions_community/schemer/develop/sample.cpp b/Libs/schemer/develop/sample.cpp similarity index 100% rename from Functions/helper_functions_community/schemer/develop/sample.cpp rename to Libs/schemer/develop/sample.cpp diff --git a/Functions/helper_functions_community/schemer/develop/sample.html b/Libs/schemer/develop/sample.html similarity index 100% rename from Functions/helper_functions_community/schemer/develop/sample.html rename to Libs/schemer/develop/sample.html diff --git a/Functions/helper_functions_community/schemer/develop/sample.java b/Libs/schemer/develop/sample.java similarity index 100% rename from Functions/helper_functions_community/schemer/develop/sample.java rename to Libs/schemer/develop/sample.java diff --git a/Functions/helper_functions_community/schemer/develop/sample.m b/Libs/schemer/develop/sample.m similarity index 100% rename from Functions/helper_functions_community/schemer/develop/sample.m rename to Libs/schemer/develop/sample.m diff --git a/Functions/helper_functions_community/schemer/develop/sample.tlc b/Libs/schemer/develop/sample.tlc similarity index 100% rename from Functions/helper_functions_community/schemer/develop/sample.tlc rename to Libs/schemer/develop/sample.tlc diff --git a/Functions/helper_functions_community/schemer/develop/sample.v b/Libs/schemer/develop/sample.v similarity index 100% rename from Functions/helper_functions_community/schemer/develop/sample.v rename to Libs/schemer/develop/sample.v diff --git a/Functions/helper_functions_community/schemer/develop/sample.vhdl b/Libs/schemer/develop/sample.vhdl similarity index 100% rename from Functions/helper_functions_community/schemer/develop/sample.vhdl rename to Libs/schemer/develop/sample.vhdl diff --git a/Functions/helper_functions_community/schemer/develop/sample.x3d b/Libs/schemer/develop/sample.x3d similarity index 100% rename from Functions/helper_functions_community/schemer/develop/sample.x3d rename to Libs/schemer/develop/sample.x3d diff --git a/Functions/helper_functions_community/schemer/develop/sample.x3dv b/Libs/schemer/develop/sample.x3dv similarity index 100% rename from Functions/helper_functions_community/schemer/develop/sample.x3dv rename to Libs/schemer/develop/sample.x3dv diff --git a/Functions/helper_functions_community/schemer/develop/sample.xml b/Libs/schemer/develop/sample.xml similarity index 100% rename from Functions/helper_functions_community/schemer/develop/sample.xml rename to Libs/schemer/develop/sample.xml diff --git a/Functions/helper_functions_community/schemer/develop/short_sample.m b/Libs/schemer/develop/short_sample.m similarity index 100% rename from Functions/helper_functions_community/schemer/develop/short_sample.m rename to Libs/schemer/develop/short_sample.m diff --git a/Functions/helper_functions_community/schemer/develop/template_scheme.prf b/Libs/schemer/develop/template_scheme.prf similarity index 100% rename from Functions/helper_functions_community/schemer/develop/template_scheme.prf rename to Libs/schemer/develop/template_scheme.prf diff --git a/Functions/helper_functions_community/schemer/logo.png b/Libs/schemer/logo.png similarity index 100% rename from Functions/helper_functions_community/schemer/logo.png rename to Libs/schemer/logo.png diff --git a/Functions/helper_functions_community/schemer/schemer_export.m b/Libs/schemer/schemer_export.m similarity index 100% rename from Functions/helper_functions_community/schemer/schemer_export.m rename to Libs/schemer/schemer_export.m diff --git a/Functions/helper_functions_community/schemer/schemer_import.m b/Libs/schemer/schemer_import.m similarity index 100% rename from Functions/helper_functions_community/schemer/schemer_import.m rename to Libs/schemer/schemer_import.m diff --git a/Functions/helper_functions_community/schemer/schemes/.gitattributes b/Libs/schemer/schemes/.gitattributes similarity index 100% rename from Functions/helper_functions_community/schemer/schemes/.gitattributes rename to Libs/schemer/schemes/.gitattributes diff --git a/Functions/helper_functions_community/schemer/schemes/.gitignore b/Libs/schemer/schemes/.gitignore similarity index 100% rename from Functions/helper_functions_community/schemer/schemes/.gitignore rename to Libs/schemer/schemes/.gitignore diff --git a/Functions/helper_functions_community/schemer/schemes/CONTRIBUTING.md b/Libs/schemer/schemes/CONTRIBUTING.md similarity index 100% rename from Functions/helper_functions_community/schemer/schemes/CONTRIBUTING.md rename to Libs/schemer/schemes/CONTRIBUTING.md diff --git a/Functions/helper_functions_community/schemer/schemes/LICENSE b/Libs/schemer/schemes/LICENSE similarity index 100% rename from Functions/helper_functions_community/schemer/schemes/LICENSE rename to Libs/schemer/schemes/LICENSE diff --git a/Functions/helper_functions_community/schemer/schemes/README.md b/Libs/schemer/schemes/README.md similarity index 100% rename from Functions/helper_functions_community/schemer/schemes/README.md rename to Libs/schemer/schemes/README.md diff --git a/Functions/helper_functions_community/schemer/schemes/SilasColorSchemeForMATLAB.prf b/Libs/schemer/schemes/SilasColorSchemeForMATLAB.prf similarity index 100% rename from Functions/helper_functions_community/schemer/schemes/SilasColorSchemeForMATLAB.prf rename to Libs/schemer/schemes/SilasColorSchemeForMATLAB.prf diff --git a/Functions/helper_functions_community/schemer/schemes/cobalt.prf b/Libs/schemer/schemes/cobalt.prf similarity index 100% rename from Functions/helper_functions_community/schemer/schemes/cobalt.prf rename to Libs/schemer/schemes/cobalt.prf diff --git a/Functions/helper_functions_community/schemer/schemes/darkmate.prf b/Libs/schemer/schemes/darkmate.prf similarity index 100% rename from Functions/helper_functions_community/schemer/schemes/darkmate.prf rename to Libs/schemer/schemes/darkmate.prf diff --git a/Functions/helper_functions_community/schemer/schemes/darksteel.prf b/Libs/schemer/schemes/darksteel.prf similarity index 100% rename from Functions/helper_functions_community/schemer/schemes/darksteel.prf rename to Libs/schemer/schemes/darksteel.prf diff --git a/Functions/helper_functions_community/schemer/schemes/default.prf b/Libs/schemer/schemes/default.prf similarity index 100% rename from Functions/helper_functions_community/schemer/schemes/default.prf rename to Libs/schemer/schemes/default.prf diff --git a/Functions/helper_functions_community/schemer/schemes/matrix.prf b/Libs/schemer/schemes/matrix.prf similarity index 100% rename from Functions/helper_functions_community/schemer/schemes/matrix.prf rename to Libs/schemer/schemes/matrix.prf diff --git a/Functions/helper_functions_community/schemer/schemes/monokai.prf b/Libs/schemer/schemes/monokai.prf similarity index 100% rename from Functions/helper_functions_community/schemer/schemes/monokai.prf rename to Libs/schemer/schemes/monokai.prf diff --git a/Functions/helper_functions_community/schemer/schemes/oblivion.prf b/Libs/schemer/schemes/oblivion.prf similarity index 100% rename from Functions/helper_functions_community/schemer/schemes/oblivion.prf rename to Libs/schemer/schemes/oblivion.prf diff --git a/Functions/helper_functions_community/schemer/schemes/screenshots/cobalt.png b/Libs/schemer/schemes/screenshots/cobalt.png similarity index 100% rename from Functions/helper_functions_community/schemer/schemes/screenshots/cobalt.png rename to Libs/schemer/schemes/screenshots/cobalt.png diff --git a/Functions/helper_functions_community/schemer/schemes/screenshots/darkmate.png b/Libs/schemer/schemes/screenshots/darkmate.png similarity index 100% rename from Functions/helper_functions_community/schemer/schemes/screenshots/darkmate.png rename to Libs/schemer/schemes/screenshots/darkmate.png diff --git a/Functions/helper_functions_community/schemer/schemes/screenshots/darksteel.png b/Libs/schemer/schemes/screenshots/darksteel.png similarity index 100% rename from Functions/helper_functions_community/schemer/schemes/screenshots/darksteel.png rename to Libs/schemer/schemes/screenshots/darksteel.png diff --git a/Functions/helper_functions_community/schemer/schemes/screenshots/default.png b/Libs/schemer/schemes/screenshots/default.png similarity index 100% rename from Functions/helper_functions_community/schemer/schemes/screenshots/default.png rename to Libs/schemer/schemes/screenshots/default.png diff --git a/Functions/helper_functions_community/schemer/schemes/screenshots/matrix.png b/Libs/schemer/schemes/screenshots/matrix.png similarity index 100% rename from Functions/helper_functions_community/schemer/schemes/screenshots/matrix.png rename to Libs/schemer/schemes/screenshots/matrix.png diff --git a/Functions/helper_functions_community/schemer/schemes/screenshots/monokai.png b/Libs/schemer/schemes/screenshots/monokai.png similarity index 100% rename from Functions/helper_functions_community/schemer/schemes/screenshots/monokai.png rename to Libs/schemer/schemes/screenshots/monokai.png diff --git a/Functions/helper_functions_community/schemer/schemes/screenshots/oblivion.png b/Libs/schemer/schemes/screenshots/oblivion.png similarity index 100% rename from Functions/helper_functions_community/schemer/schemes/screenshots/oblivion.png rename to Libs/schemer/schemes/screenshots/oblivion.png diff --git a/Functions/helper_functions_community/schemer/schemes/screenshots/solarized-dark.png b/Libs/schemer/schemes/screenshots/solarized-dark.png similarity index 100% rename from Functions/helper_functions_community/schemer/schemes/screenshots/solarized-dark.png rename to Libs/schemer/schemes/screenshots/solarized-dark.png diff --git a/Functions/helper_functions_community/schemer/schemes/screenshots/solarized-light.png b/Libs/schemer/schemes/screenshots/solarized-light.png similarity index 100% rename from Functions/helper_functions_community/schemer/schemes/screenshots/solarized-light.png rename to Libs/schemer/schemes/screenshots/solarized-light.png diff --git a/Functions/helper_functions_community/schemer/schemes/screenshots/tango.png b/Libs/schemer/schemes/screenshots/tango.png similarity index 100% rename from Functions/helper_functions_community/schemer/schemes/screenshots/tango.png rename to Libs/schemer/schemes/screenshots/tango.png diff --git a/Functions/helper_functions_community/schemer/schemes/screenshots/vibrant.png b/Libs/schemer/schemes/screenshots/vibrant.png similarity index 100% rename from Functions/helper_functions_community/schemer/schemes/screenshots/vibrant.png rename to Libs/schemer/schemes/screenshots/vibrant.png diff --git a/Functions/helper_functions_community/schemer/schemes/solarized-dark.prf b/Libs/schemer/schemes/solarized-dark.prf similarity index 100% rename from Functions/helper_functions_community/schemer/schemes/solarized-dark.prf rename to Libs/schemer/schemes/solarized-dark.prf diff --git a/Functions/helper_functions_community/schemer/schemes/solarized-light.prf b/Libs/schemer/schemes/solarized-light.prf similarity index 100% rename from Functions/helper_functions_community/schemer/schemes/solarized-light.prf rename to Libs/schemer/schemes/solarized-light.prf diff --git a/Functions/helper_functions_community/schemer/schemes/tango.prf b/Libs/schemer/schemes/tango.prf similarity index 100% rename from Functions/helper_functions_community/schemer/schemes/tango.prf rename to Libs/schemer/schemes/tango.prf diff --git a/Functions/helper_functions_community/schemer/schemes/vibrant.prf b/Libs/schemer/schemes/vibrant.prf similarity index 100% rename from Functions/helper_functions_community/schemer/schemes/vibrant.prf rename to Libs/schemer/schemes/vibrant.prf diff --git a/Functions/helper_functions_community/sendolmail.m b/Libs/sendolmail.m similarity index 100% rename from Functions/helper_functions_community/sendolmail.m rename to Libs/sendolmail.m diff --git a/Functions/settingsdlg/.gitignore b/Libs/settingsdlg/.gitignore similarity index 100% rename from Functions/settingsdlg/.gitignore rename to Libs/settingsdlg/.gitignore diff --git a/Functions/settingsdlg/License.txt b/Libs/settingsdlg/License.txt similarity index 98% rename from Functions/settingsdlg/License.txt rename to Libs/settingsdlg/License.txt index b808cd3..bedf626 100644 --- a/Functions/settingsdlg/License.txt +++ b/Libs/settingsdlg/License.txt @@ -1,26 +1,26 @@ -Copyright (c) 2018, Rody Oldenhuis -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -The views and conclusions contained in the software and documentation are those -of the authors and should not be interpreted as representing official policies, -either expressed or implied, of this project. +Copyright (c) 2018, Rody Oldenhuis +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +The views and conclusions contained in the software and documentation are those +of the authors and should not be interpreted as representing official policies, +either expressed or implied, of this project. diff --git a/Functions/settingsdlg/README.md b/Libs/settingsdlg/README.md similarity index 100% rename from Functions/settingsdlg/README.md rename to Libs/settingsdlg/README.md diff --git a/Functions/settingsdlg/Screen.png b/Libs/settingsdlg/Screen.png similarity index 100% rename from Functions/settingsdlg/Screen.png rename to Libs/settingsdlg/Screen.png diff --git a/Functions/settingsdlg/settingsdlg.m b/Libs/settingsdlg/settingsdlg.m similarity index 100% rename from Functions/settingsdlg/settingsdlg.m rename to Libs/settingsdlg/settingsdlg.m diff --git a/Functions/settingsdlg/settingsdlg.odt b/Libs/settingsdlg/settingsdlg.odt similarity index 100% rename from Functions/settingsdlg/settingsdlg.odt rename to Libs/settingsdlg/settingsdlg.odt diff --git a/Functions/settingsdlg/settingsdlg.pdf b/Libs/settingsdlg/settingsdlg.pdf similarity index 100% rename from Functions/settingsdlg/settingsdlg.pdf rename to Libs/settingsdlg/settingsdlg.pdf diff --git a/projects/HighSpeedExperiment_2024/auswertung/analyzeDB.m b/projects/HighSpeedExperiment_2024/auswertung/analyzeDB.m new file mode 100644 index 0000000..0183686 --- /dev/null +++ b/projects/HighSpeedExperiment_2024/auswertung/analyzeDB.m @@ -0,0 +1,85 @@ +basePath = 'C:\Users\Silas\Documents\MATLAB\Datensätze\sioe_labor\'; +useGui = 0; + +db = DBHandler("pathToDB",[basePath,'silas_labor.db']); +if useGui + filterParams = db.promptFilterParameters(); + selectedFields = db.promptSelectFields(); +else + filterParams = db.tables; + filterParams.Configurations = struct( ... + 'bitrate', [], ... + 'db_mode', [], ... + 'fiber_length', 10, ... + 'interference_attenuation', [], ... + 'interference_path_length', [], ... + 'is_mpi', 0, ... + 'pam_level', [], ... + 'precomp_amp', [], ... + 'rop_attenuation', 0, ... + 'symbolrate', [], ... + 'v_awg', [], ... + 'v_bias', [], ... + 'wavelength', 1310 ... + ); + filterParams.Equalizer.eq_type = equalizer_structure.vnle_pf_mlse; + filterParams.Equalizer.eq_id = equalizer_structure.vnle; + selectedFields = {'Runs.run_id','BERs.ber_id','Equalizer.eq_id','Equalizer.eq_type','BERs.ber','BERs.occurrence',... + 'Configurations.db_mode','Configurations.pam_level','Configurations.bitrate','Configurations.symbolrate','Configurations.fiber_length','Configurations.wavelength','Configurations.precomp_amp',... + 'Measurements.power_rop','Measurements.power_laser','Measurements.power_pd_in'}; +end + + +[dataTable,~] = db.queryDB(filterParams, selectedFields); + +% Calculate the mean BER for each combination of 'run_id' and 'eq_type' +groupedData = groupsummary(dataTable, {'run_id', 'eq_type'}, 'mean', {'ber', 'power_rop','power_pd_in'}); + +% Extract unique rows from dataTable for each run_id with relevant configuration details +uniqueConfigFields = {'run_id', 'pam_level', 'bitrate','symbolrate', 'fiber_length', 'wavelength', 'precomp_amp', 'db_mode'}; +[~, uniqueIdx] = unique(dataTable.run_id); % Get unique run_id indices +configDetails = dataTable(uniqueIdx, uniqueConfigFields); % Extract unique configurations for each run_id + +% Prepare the join key for both groupedData and configDetails +groupedDataTable = table(groupedData.run_id, groupedData.eq_type, groupedData.GroupCount, groupedData.mean_ber,groupedData.mean_power_rop,groupedData.mean_power_pd_in, ... + 'VariableNames', {'run_id', 'eq_type', 'GroupCount', 'mean_ber','mean_power_rop','mean_power_pd_in'}); + +% Join groupedData with configDetails on the run_id field +joinedData = join(groupedDataTable, configDetails, 'Keys', 'run_id'); + + + + +a=plot(fsym_vals.*1e-9.*log2(M_vals(modulation_iter)),ber_ffe(:,modulation_iter),... + 'Color',cols(modulation_iter,:),'MarkerSize',2,'LineWidth',1,... + 'Marker','o','MarkerFaceColor',cols(modulation_iter,:),'MarkerEdgeColor','black',... + 'DisplayName',['PAM ',num2str(M_vals(modulation_iter))]); + +a.DataTipTemplate.DataTipRows(1).Label = 'Bitr'; +a.DataTipTemplate.DataTipRows(1).Format = ['%.1f',' Gbps']; + +a.DataTipTemplate.DataTipRows(2).Label = 'BER'; +a.DataTipTemplate.DataTipRows(2).Format ='%.1e'; + +a.DataTipTemplate.DataTipRows(3).Label = 'P_{out}'; +a.DataTipTemplate.DataTipRows(3).Value = rop(:,modulation_iter); +a.DataTipTemplate.DataTipRows(3).Format = ['%.2f',' dBm']; + +a.DataTipTemplate.DataTipRows(4).Label = 'Baudr'; +a.DataTipTemplate.DataTipRows(4).Value = fsym_vals.*1e-9; +a.DataTipTemplate.DataTipRows(4).Format = ['%.1f',' GBd']; + + +a.DataTipTemplate.FontSize = 9; +a.DataTipTemplate.FontName = 'arial'; + +% Continue with the rest of your plot settings +title('Opt B2B') +yline(3.8e-3, 'DisplayName', 'HD-FEC', 'LineStyle', '--', 'HandleVisibility', 'off'); +xlabel('Bit Rate in GBps'); +ylabel('Bit Error Rate (BER)'); +set(gca, 'yscale', 'log'); +set(gca, 'Box', 'on'); +grid on; +grid minor; +legend('Interpreter', 'none'); diff --git a/projects/HighSpeedExperiment_2024/auswertung/auswertungs_app.mlapp b/projects/HighSpeedExperiment_2024/auswertung/auswertungs_app.mlapp new file mode 100644 index 0000000..c7cc12d Binary files /dev/null and b/projects/HighSpeedExperiment_2024/auswertung/auswertungs_app.mlapp differ diff --git a/projects/HighSpeedExperiment_2024/auswertung/runDSP.m b/projects/HighSpeedExperiment_2024/auswertung/runDSP.m index 25f8958..91398b6 100644 --- a/projects/HighSpeedExperiment_2024/auswertung/runDSP.m +++ b/projects/HighSpeedExperiment_2024/auswertung/runDSP.m @@ -1,85 +1,147 @@ + basePath = 'C:\Users\Silas\Documents\MATLAB\Datensätze\sioe_labor\'; +useGui = 0; + db = DBHandler("pathToDB",[basePath,'silas_labor.db']); +if useGui + filterParams = db.promptFilterParameters(); + selectedFields = db.promptSelectFields(); +else + filterParams = db.tables; + filterParams.Configurations = struct( ... + 'bitrate', [], ... + 'db_mode', [], ... + 'fiber_length', 10, ... + 'interference_attenuation', [], ... + 'interference_path_length', [], ... + 'is_mpi', 0, ... + 'pam_level', [], ... + 'precomp_amp', [], ... + 'rop_attenuation', 0, ... + 'symbolrate', [], ... + 'v_awg', [], ... + 'v_bias', [], ... + 'wavelength', 1310 ... + ); + % filterParams.Runs.run_id = 3303; + %filterParams.Equalizer.eq_id = equalizer_structure.vnle; + selectedFields = {'Runs.run_id','Runs.tx_bits_path', 'Runs.tx_symbols_path', 'Runs.rx_sync_path','Runs.rx_raw_path',... + 'Configurations.db_mode','Configurations.pam_level','Configurations.bitrate','Configurations.fiber_length','Configurations.wavelength','Configurations.precomp_amp'}; +end -%1) Get path info from DB -filterParams = db.promptFilterParameters(); -filterParams = db.tables; -filterParams.Configurations = struct( ... - 'bitrate', 300e9, ... - 'db_mode', 0, ... - 'fiber_length', 10, ... - 'interference_attenuation', [], ... - 'interference_path_length', [], ... - 'is_mpi', 0, ... - 'pam_level', 4, ... - 'precomp_amp', [], ... - 'rop_attenuation', 0, ... - 'symbolrate', [], ... - 'v_awg', [], ... - 'v_bias', [], ... - 'wavelength', 1310 ... -); -% filterParams.Equalizer.eq_id = 1; +[dataTable,sql_query] = db.queryDB(filterParams, selectedFields); +fprintf('Found %d entries for requested Configuration. IDs are: %s \n',size(dataTable,1),jsonencode(dataTable.run_id)); -% selectedFields = db.promptSelectFields(); -selectedFields = {'Runs.run_id','Runs.tx_bits_path', 'Runs.tx_symbols_path', 'Runs.rx_sync_path','Runs.rx_raw_path','Configurations.db_mode'}; -pathTable = db.getPathsWithFlexibleFilter(filterParams, selectedFields); -fprintf('Found %d entries for requested Configuration. IDs are: %s \n',size(pathTable,1),jsonencode(pathTable.run_id)); +%2) Process Measurement Config +for i = 1:size(dataTable,1) + fprintf('\n%s CURRENT ID: %d == %d KM == %s PAM %d == %d Gbit/s == %d nm %s \n \n', repmat('=', 1, 10), dataTable.run_id(i), dataTable.fiber_length(i) ,db_mode(dataTable.db_mode(i)), dataTable.pam_level(i) ,dataTable.bitrate(i).*1e-9,dataTable.wavelength(i), repmat('=', 1, 10)); % Print a blank line, then a thick line of 80 '=' characters, then another blank line -selectedBerFields = {'BERs.ber_id','BERs.run_id','BERs.eq_id'}; -berresult = db.getPathsWithFlexibleFilter(filterParams, selectedBerFields); + % FROM NOW ON, ONE Run_id IS CHOSEN AND WILL BE DSP'd -%2) Process - -for i = 1:size(pathTable,1) - - tx_bits = load([basePath, char(pathTable.tx_bits_path(i))]); - tx_bits = tx_bits.Bits; - tx_symbols = load([basePath, char(pathTable.tx_symbols_path(i))]); - tx_symbols = tx_symbols.Symbols; - rx_sync = load([basePath, char(pathTable.rx_sync_path(i))]); - rx_sync = rx_sync.S; + tx_bits = load([basePath, char(dataTable.tx_bits_path(i))]); + tx_bits = tx_bits.Bits; + tx_symbols = load([basePath, char(dataTable.tx_symbols_path(i))]); + tx_symbols = tx_symbols.Symbols; + rx_sync = load([basePath, char(dataTable.rx_sync_path(i))]); + rx_sync = rx_sync.S; %rx_raw = load([basePath, char(result.rx_raw_path(i))]); - - %2.1) EQ - for o = 1:numel(rx_sync) + + ffe_order=[50,0,0]; + vnle_order=[50,7,7]; + dfe_order = [0 0 0]; + + len_tr = 4096*2; + mu_ffe = [0.0004 0.0004 0.0004]; + mu_dfe = 0.0004; + mu_dc = 0.05; + + dfe_ = sum(dfe_order)>0; + + %Loop through sliced oscilloscope measurement + parfor o = 1:numel(rx_sync) rx_sig = rx_sync{o}; - switch pathTable.db_mode(i) - case 0 - %normal signaling - eq_ = EQ("Ne",[50,7,7],"Nb",[0,0,0],"training_length",4096*2,"training_loops",5,"dd_loops",5,"K",2,"DCmu",0.05,"DDmu",[0.0004 0.0004 0.0004 0.0004 ],"DFEmu",0.005,"FFEmu",0,"plotfinal",0,"ideal_dfe",1); - eq_sig = vnle(eq_,rx_sig,tx_symbols); + M = dataTable.pam_level(i); - case 1 - %db targeting => less precompensation; pre-coded + switch dataTable.db_mode(i) + + case db_mode.no_db + + %FFE + eq_ffe(o) = EQ("Ne",ffe_order,"Nb",dfe_order,"training_length",len_tr,"training_loops",5,"dd_loops",5,"K",2,"DCmu",0.05,"DDmu",[mu_ffe mu_dfe],"DFEmu",0.005,"FFEmu",0,"plotfinal",0,"ideal_dfe",1); + [eq_sig,eq_noise,ber_ffe(o),totalErrors] = vnle( eq_ffe(o),M,rx_sig,tx_symbols, tx_bits); + + %VNLE + eq_vnle(o) = EQ("Ne",vnle_order,"Nb",dfe_order,"training_length",len_tr,"training_loops",5,"dd_loops",5,"K",2,"DCmu",0.05,"DDmu",[mu_ffe mu_dfe],"DFEmu",0.005,"FFEmu",0,"plotfinal",0,"ideal_dfe",1); + [eq_sig,eq_noise,ber_vnle(o),totalErrors] = vnle(eq_vnle(o),M,rx_sig,tx_symbols, tx_bits); + + %VNLE + PF + MLSE + eq_mlse(o) = EQ("Ne",vnle_order,"Nb",dfe_order,"training_length",len_tr,"training_loops",5,"dd_loops",5,"K",2,"DCmu",0.05,"DDmu",[mu_ffe mu_dfe],"DFEmu",0.005,"FFEmu",0,"plotfinal",0,"ideal_dfe",1); + pf_(o) = Postfilter("ncoeff",2); + mlse_(o) = MLSE("DIR",[0,0],"duobinary_output",0,"M",[],"trellis_states",[]); + [eq_sig,eq_noise,ber_mlse(o),totalErrors] = vnle_postfilter_mlse(eq_mlse(o) , pf_(o), mlse_(o),M, rx_sig,tx_symbols, tx_bits); + + case db_mode.db_precoded + + %EQ targets DB => less precompensation; pre-coded + M = dataTable.pam_level(i); + mlse_db_pre(o) = MLSE("DIR",[1,1],"duobinary_output",1,"M",M,"trellis_states",PAMmapper(M,0).levels); + eq_db_pre(o) = EQ("Ne",vnle_order,"Nb",dfe_order,"training_length",len_tr,"training_loops",5,"dd_loops",5,"K",2,"DCmu",0.05,"DDmu",[mu_ffe mu_dfe],"DFEmu",0.005,"FFEmu",0,"plotfinal",0,"ideal_dfe",1); + [eq_sig,eq_noise,ber_db_pre(o),totalErrors] = duobinary_target(eq_db_pre(o), mlse_db_pre(o),M, rx_sig, tx_symbols, tx_bits); + %->append BER to DB + + case db_mode.db_encoded - case 2 %db signaling => db encoded - + M = dataTable.pam_level(i); + mlse_db_enc(o) = MLSE("DIR",[1,1],"duobinary_output",1,"M",M,"trellis_states",PAMmapper(M,0).levels); + eq_db_enc(o) = EQ("Ne",vnle_order,"Nb",dfe_order,"training_length",len_tr,"training_loops",5,"dd_loops",5,"K",2,"DCmu",0.05,"DDmu",[mu_ffe mu_dfe],"DFEmu",0.005,"FFEmu",0,"plotfinal",0,"ideal_dfe",1); + [eq_sig,eq_noise,ber_db_enc(o),totalErrors] = duobinary_signaling(eq_db_enc(o), mlse_db_enc(o),M, rx_sig, tx_symbols, tx_bits); + %->append BER to DB end - rx_bits = PAMmapper(4,0).demap(eq_sig); - [~,~,ber_vnle(o),~] = calc_ber(rx_bits.signal,tx_bits.signal,"skip_front",100,"skip_end",150,"returnErrorLocation",1); - end - %2.2) Store BER to DB Table "BERs" - % structure = ""; % Description or Comment of BER technqiue - % settings = EQ; - % - % newBer = struct(... - % 'ber_id', NaN,... - % 'run_id', current_run_id,... - % 'processing_structure', structure,... - % 'processing_settings', settings,... - % 'ber', jsonencode(ber)... - % ); - % - % db.appendToTable('BERs', newBer); + for o = 1:numel(rx_sync) + switch dataTable.db_mode(i) + + case db_mode.no_db + + %FFE + eq_type = equalizer_structure.ffe; + db.addBEREntry(ber_ffe(o), o, dataTable.run_id(i), eq_ffe(o), dfe_, [], [], eq_type, ffe_order, dfe_order, len_tr, mu_ffe, mu_dfe, mu_dc, "FFE"); + showCurrentMeasurement('EQ', string(eq_type), 'BER',ber_ffe(o), 'Mode', string(db_mode(dataTable.db_mode(i))), 'Len', dataTable.fiber_length(i) ,'PAM' , dataTable.pam_level(i) , 'GBit/s' ,dataTable.bitrate(i).*1e-9, 'Lambda' ,dataTable.wavelength(i) ); + + %VNLE + eq_type = equalizer_structure.vnle; + db.addBEREntry(ber_vnle(o), o, dataTable.run_id(i), eq_vnle(o), dfe_, [], [], eq_type, vnle_order, dfe_order, len_tr, mu_ffe, mu_dfe, mu_dc, "VNLE"); + showCurrentMeasurement('EQ', string(eq_type), 'BER',ber_vnle(o), 'Mode', string(db_mode(dataTable.db_mode(i))), 'Len', dataTable.fiber_length(i) ,'PAM' , dataTable.pam_level(i) , 'GBit/s' ,dataTable.bitrate(i).*1e-9, 'Lambda' ,dataTable.wavelength(i) ); + + %MLSE + eq_type = equalizer_structure.vnle_pf_mlse; + db.addBEREntry(ber_mlse(o), o, dataTable.run_id(i), eq_mlse(o), dfe_, mlse_(o), pf_(o), eq_type, vnle_order, dfe_order, len_tr, mu_ffe, mu_dfe, mu_dc, "VNLE;PF;MLSE"); + showCurrentMeasurement('EQ', string(eq_type), 'BER',ber_mlse(o), 'Mode', string(db_mode(dataTable.db_mode(i))), 'Len', dataTable.fiber_length(i) ,'PAM' , dataTable.pam_level(i) , 'GBit/s' ,dataTable.bitrate(i).*1e-9, 'Lambda' ,dataTable.wavelength(i) ); + + case db_mode.db_precoded + + %db_precoded + eq_type = equalizer_structure.db_precoded; + db.addBEREntry(ber_db_pre(o), o, dataTable.run_id(i), eq_db_pre(o), dfe_, mlse_db_pre(o), [], eq_type, vnle_order, dfe_order, len_tr, mu_ffe, mu_dfe, mu_dc, "DB Precode;DB Target;MLSE DB Decode;Modulo"); + showCurrentMeasurement('EQ', string(eq_type), 'BER',ber_db_pre(o), 'Mode', string(db_mode(dataTable.db_mode(i))), 'Len', dataTable.fiber_length(i) ,'PAM' , dataTable.pam_level(i) , 'GBit/s' ,dataTable.bitrate(i).*1e-9, 'Lambda' ,dataTable.wavelength(i) ); + + case db_mode.db_encoded + + %db_encoded + eq_type = equalizer_structure.db_encoded; + db.addBEREntry(ber_db_enc(o), o, dataTable.run_id(i), eq_db_enc(o), dfe_, mlse_db_enc(o), [], eq_type, vnle_order, dfe_order, len_tr, mu_ffe, mu_dfe, mu_dc, "DB Precode;DB Encode;DB Target;MLSE DB Decode;Modulo"); + showCurrentMeasurement('EQ', string(eq_type), 'BER',ber_db_enc(o), 'Mode', string(db_mode(dataTable.db_mode(i))), 'Len', dataTable.fiber_length(i) ,'PAM' , dataTable.pam_level(i) , 'GBit/s' ,dataTable.bitrate(i).*1e-9, 'Lambda' ,dataTable.wavelength(i) ); + + end + + end end -%3) Look at BER that just ran +fprintf('\n%s SIMULATION COMPLETE %s \n \n', repmat('=', 1, 35), repmat('=', 1, 35)); % Print a blank line, then a thick line of 80 '=' characters, then another blank line