plateform stringclasses 1
value | repo_name stringlengths 13 113 | name stringlengths 3 74 | ext stringclasses 1
value | path stringlengths 12 229 | size int64 23 843k | source_encoding stringclasses 9
values | md5 stringlengths 32 32 | text stringlengths 23 843k |
|---|---|---|---|---|---|---|---|---|
github | kaldi-asr/kaldi-svn-archive-master | Generate_mcTrainData_cut.m | .m | kaldi-svn-archive-master/egs/reverb/s5/local/Generate_mcTrainData_cut.m | 7,311 | utf_8 | f59dd892f0f8da04a515a2c58ff50a69 | function Generate_mcTrainData_cut(WSJ_dir_name, save_dir)
%
% Input variables:
% WSJ_dir_name: string name of user's clean wsjcam0 corpus directory
% (*Directory structure for wsjcam0 corpushas to be kept as it is after obtaining it from LDC.
% Otherwise this script does not wor... |
github | MatthewPeterKelly/icra2015_kellyRuina-master | saveResults.m | .m | icra2015_kellyRuina-master/code/saveResults.m | 3,583 | utf_8 | 2fe0395c5d562b227d85c4a1396801be | function saveResults(C,R)
save('RobustController.mat','C','R');
plotArea = [600,600]; %Area in pixels of the plot
LINE_WIDTH_HEAVY = 3;
LINE_WIDTH_LIGHT = 2;
LINE_COLOR_MAIN = [0.1, 0.1, 0.9];
LINE_COLOR_DASHED = 0.1*[1,1,1];
LINE_COLOR_OTHER = [0.9, 0.1, 0.1];
%How much to pad the axis of each subplot with white... |
github | MatthewPeterKelly/icra2015_kellyRuina-master | getMaxDisturbance.m | .m | icra2015_kellyRuina-master/code/getMaxDisturbance.m | 3,004 | utf_8 | 745dd9d1fec9328f7918c8ccc2860af7 | function out = getMaxDisturbance(in, config)
%
% Computes the worst possible disturbance for maximizing speed errors at
% the next step, in both the positive and negative directions.
%
%%% User parameters:
nSamplesInitial = 1000;
%%% Unpack the nominal controls
p = in.pushOff;
phi = in.stepAngle;
w0 = in.w0;
%%% Phy... |
github | MatthewPeterKelly/icra2015_kellyRuina-master | simulateRobust.m | .m | icra2015_kellyRuina-master/code/simulateRobust.m | 1,685 | utf_8 | c3e45b21b990d89839e8e2a8e53094cd | function nFail = simulateRobust(input, C, del, dyn)
nSim = input.nSim;
nStep = input.nStep;
nTarget = input.nTarget;
m = dyn.m;
g = dyn.g;
l = dyn.l;
nFail = 0;
nMeasured = length(C.w);
ctrl.w = C.w;
for i=1:nSim
idxTarget = randi(nTarget); %Which target speed to use?
ctrl.p = C.p(:,idxTarget );
ct... |
github | MatthewPeterKelly/icra2015_kellyRuina-master | plotController.m | .m | icra2015_kellyRuina-master/code/plotController.m | 1,816 | utf_8 | 073ff188bdf9685db9b66ce2fd01d693 | function plotController(C)
%
% This function plots the results of running the controller design process.
% For each target speed, it plots push-off impulse, step angle, and the
% one-step map.
%
nTarget = length(C.wTarget);
clf;
for i=1:nTarget
idx_1 = 1 + (i-1)*3;
idx_2 = 2 + (i-1)*3;
idx_3 ... |
github | czdiao/DirMuRS_Simple-master | NoiseLevel.m | .m | DirMuRS_Simple-master/Utilities/NoiseLevel.m | 3,583 | utf_8 | cb49f0b4634bfa13e30e20874be3014a | % NoiseLevel estimates noise level of input single noisy image.
%
% [nlevel th num] = NoiseLevel(img,patchsize,decim,conf,itr)
%
%Output parameters
% nlevel: estimated noise levels.
% th: threshold to extract weak texture patches at the last iteration.
% num: number of extracted weak texture patches at the last... |
github | czdiao/DirMuRS_Simple-master | removeBoundary.m | .m | DirMuRS_Simple-master/Utilities/removeBoundary.m | 404 | utf_8 | 018b48c3b17432917033a137f6a96497 | % removeBoundary : Remove boundary segment of an image
%
% r = removeBoundary(im,boundary_size)
%
% Inputs:
% im : input image
% boundary_size : thickness (in pixels) of boundary segment to remove
%
% Outputs:
% r - resulting trimmed array
%
% See also extendBoundary
function r = removeBoundary(im,boundary_size)
[M,... |
github | czdiao/DirMuRS_Simple-master | argselectCheck.m | .m | DirMuRS_Simple-master/Utilities/argselectCheck.m | 1,182 | utf_8 | 767a79284844f27f67f1c781d5c6bb28 | % argselectCheck : check if control parameters are valid
%
% function argselectCheck(control_params,varargin_in)
%
% Inputs:
% control_params and varargin_in are both cell arrays
% that are lists of pairs 'name1',value1,'name2',value2,...
%
% This function checks that every name in varargin_in is one of the name... |
github | czdiao/DirMuRS_Simple-master | argselectAssign.m | .m | DirMuRS_Simple-master/Utilities/argselectAssign.m | 839 | utf_8 | e64369921270a9d408294087d85e320f | % argselectAssign : assign variables in calling workspace
%
% function argselectAssign(variable_value_pairs)
%
% Inputs :
% variable_value_pairs is a cell list of form
% 'variable1',value1,'variable2',value2,...
% This function assigns variable1=value1 ... etc in the *callers* workspace
%
% This is used at beg... |
github | czdiao/DirMuRS_Simple-master | makeInteriorMask.m | .m | DirMuRS_Simple-master/Utilities/makeInteriorMask.m | 527 | utf_8 | 349ea021f893d72f683e40477ebfdc1d | % makeInteriorMask : return logical mask for interior region
%
% returns a logical array with dimension dim, with a rectangular inner
% region filled with 1's and a boundary region of thickness boundary
% filled with 0's
%
% Inputs:
% dim - size of desired output
% boundary - thickness of boundary segment
%
% Outputs:
... |
github | czdiao/DirMuRS_Simple-master | shift.m | .m | DirMuRS_Simple-master/Utilities/shift.m | 453 | utf_8 | 3e12f9ab9679c3cc88b56885c167121a | % [RES] = shift(MTX, OFFSET)
%
% Circular shift 2D matrix samples by OFFSET (a [Y,X] 2-vector),
% such that RES(POS) = MTX(POS-OFFSET).
function res = shift(mtx, offset)
dims = size(mtx);
offset = mod(-offset,dims);
res = [ mtx(offset(1)+1:dims(1), offset(2)+1:dims(2)), ...
mtx(offset(1)+1:... |
github | czdiao/DirMuRS_Simple-master | plotgui.m | .m | DirMuRS_Simple-master/Utilities/plotgui.m | 5,690 | utf_8 | 26ddedc52e84dc8ab2fbf1376fe6f7dd | function varargout = plotgui(varargin)
% PLOTGUI MATLAB code for plotgui.fig
% PLOTGUI, by itself, creates a new PLOTGUI or raises the existing
% singleton*.
%
% H = PLOTGUI returns the handle to a new PLOTGUI or the handle to
% the existing singleton*.
%
% PLOTGUI('CALLBACK',hObject,eventData,... |
github | czdiao/DirMuRS_Simple-master | extendBoundary.m | .m | DirMuRS_Simple-master/Utilities/extendBoundary.m | 2,481 | utf_8 | 280d567e75eeb82f5e2a77ffa7990cbd | % extendBoundary : Extend image on all sides by a specified number of pixels
%
% function r = boundaryExtend(im,Nout,...)
%
% Inputs
% im : input image
% Nout : thickness of border segment in pixels
%
% Outputs
% r : resulting extended image
%
% Selectable parameters :
% 'method' : may be 'reflect' (default), 'reflect... |
github | czdiao/DirMuRS_Simple-master | view3d.m | .m | DirMuRS_Simple-master/Utilities/view3d/view3d.m | 13,141 | utf_8 | 3e842df7eaf3e289172aef0893fda2b1 | function varargout = view3d(varargin)
%VIEW3D GUI for interactive viewing of 3D Volumes
% VIEW3D is used view orthographic slices of 3D volumes
%
% Type in an expression that generates a 3D array
% then press the Display button
%
% 3D expressions such as: rand(50,40,30) or
% the name or a 3D array variabl... |
github | czdiao/DirMuRS_Simple-master | deblur_freq_decomp.m | .m | DirMuRS_Simple-master/DenoiseTest/deblur_freq_decomp.m | 4,351 | utf_8 | 47277ebce10731b03479965696f23b20 | function y = deblur_freq_decomp( x, ker, WT, Nsig, s )
%DEBLUR_FREQ_DECOMP
%
%
%
%
% Chenzhe
% Jun, 2016
%
%
[m, n] = size(x);
[nker,mker]=size(ker);
tmp=zeros(m,n);
tmp(1:nker,1:mker)=ker;
tmp=circshift(tmp,[-floor(nker/2),-floor(mker/2)]);
fker = fft2(tmp);
% Method 1
tol = 1e-15;
TF = (abs(fker)>tol);
fk... |
github | czdiao/DirMuRS_Simple-master | deblur_L1_analysis.m | .m | DirMuRS_Simple-master/DenoiseTest/deblur_L1_analysis.m | 4,856 | utf_8 | 2abeef583a3c6297cc3bae7cb0d61982 | function [ u ] = deblur_L1_analysis( x, ker, blur, Nsig, wavetrans, x_true )
%DEBLUR_L1_ANALYSIS Deblur an image using L1 analysis based model
%
% This function is implementation of Split Bregman method based on:
% J.-F. Cai, S. Osher, and Z. Shen.
% Split bregman methods and frame based image restoratio... |
github | czdiao/DirMuRS_Simple-master | emgm.m | .m | DirMuRS_Simple-master/emgm/emgm.m | 3,145 | utf_8 | 6ea9a0550ce4d3145baeaddea9e10479 | function [label, model, llh] = emgm(X, init)
% Perform EM algorithm for fitting the Gaussian mixture model.
% X: d x n data matrix
% init: k (1 x 1) or label (1 x n, 1<=label(i)<=k) or center (d x k)
% Written by Michael Chen (sth4nth@gmail.com).
%% initialization
fprintf('EM for Gaussian mixture: running ... \n');... |
github | czdiao/DirMuRS_Simple-master | vbgm.m | .m | DirMuRS_Simple-master/emgm/vbgm.m | 5,343 | utf_8 | 03c1211deef74d3e3521f45f1e7b04ad | function [label, model, L] = vbgm(X, init, prior)
% Perform variational Bayesian inference for Gaussian mixture.
% X: d x n data matrix
% init: k (1 x 1) or label (1 x n, 1<=label(i)<=k) or center (d x k)
% Reference: Pattern Recognition and Machine Learning by Christopher M. Bishop (P.474)
% Written by Michael Che... |
github | czdiao/DirMuRS_Simple-master | error_ellipse.m | .m | DirMuRS_Simple-master/emgm/error_ellipse.m | 8,066 | utf_8 | 88ee33435327a635d2d76393c95234ae | function h=error_ellipse(varargin)
% ERROR_ELLIPSE - plot an error ellipse, or ellipsoid, defining confidence region
% ERROR_ELLIPSE(C22) - Given a 2x2 covariance matrix, plot the
% associated error ellipse, at the origin. It returns a graphics handle
% of the ellipse that was drawn.
%
% ERROR_ELLIPSE(C33) ... |
github | czdiao/DirMuRS_Simple-master | emgm2.m | .m | DirMuRS_Simple-master/emgm/emgm2.m | 3,255 | utf_8 | c558144c6fdedc2cd684057708eb9678 | function [label, model, llh] = emgm2(X, init)
% Perform EM algorithm for fitting the Gaussian mixture model.
% X: d x n data matrix
% init: model
%% initialization
fprintf('EM-like for Gaussian mixture: running ... \n');
% R = initialization(X,init);
R = expectation(X,init);
[~,label(1,:)] = max(R,[],2);
R = R(:... |
github | czdiao/DirMuRS_Simple-master | impulsenoise.m | .m | DirMuRS_Simple-master/DTCWT_SplitHipass/Inpainting_Test/impulsenoise.m | 1,874 | utf_8 | 8effe8b8d7b17904a32679fe264b4c9f | %% Add Impulse Noise to images
%% Impulse Noises 0 - Salt & Pepper noise
% 1 - Random Valued impulse noise.
%% impulse noises are classified into two major types
% (i) salt and pepper noise (equal height impulses) impulse values are
% represented as ??and ?55?
% (ii) random-valued impulse noise ... |
github | czdiao/DirMuRS_Simple-master | localsoft_mag.m | .m | DirMuRS_Simple-master/DTCWT_SplitHipass/Test_Frame_L1_Opt/localsoft_mag.m | 868 | utf_8 | 43fa2a55174b7f974ee79ba9c88404c7 | function [ W_new ] = localsoft_mag( W, Ssig, sigmaN )
%LOCALSOFT_MAG Summary of this function goes here
% Detailed explanation goes here
W_new = W;
nL = W.nlevel;
nB = W.nband;
I = sqrt(-1);
for ilevel = 1:nL-1
for dir = 1:2
for iband = 1:nB
coeff_real = W.coeff{ilevel}{1}{dir}{iband};
... |
github | czdiao/DirMuRS_Simple-master | reconstruction.m | .m | DirMuRS_Simple-master/Transforms/time/@DualTreeSplitHigh2D/reconstruction.m | 1,375 | utf_8 | bd5a2ec4660c590da85f1a8ce071a448 | function y = reconstruction( obj )
%RECONSTRUCTION Wavelet Reconstruction function
%
% This function is the inverse of 2D DT-CWT with Split Hipass
%
% Chenzhe
% Jan, 2016
%
w = obj.coeff;
J = obj.nlevel;
FS_fb1d = obj.FirstStageFB;
fb1d = obj.FilterBank;
u_hi = obj.u_hi;
u1 = u_hi(1);
u2 = u_hi(2);
for j = 1... |
github | czdiao/DirMuRS_Simple-master | decomposition.m | .m | DirMuRS_Simple-master/Transforms/time/@DualTreeSplitHigh2D/decomposition.m | 1,529 | utf_8 | 619af59cfca7e967c37b73f249b50f33 | function w = decomposition( obj, x )
%DECOMPOSITION Wavelet decomposition function
%
% This is 2D DT-CWT with Split the highpass
%
% Chenzhe
% Jan, 2016
J = obj.nlevel;
FS_fb1d = obj.FirstStageFB;
fb1d = obj.FilterBank;
u_hi = obj.u_hi;
w = cell(1, J+1);
x = x/2; % to normalize to tight frame
% u1, u2 to sp... |
github | czdiao/DirMuRS_Simple-master | iDualTree2d_SplitHighLowComplex.m | .m | DirMuRS_Simple-master/Transforms/time/DualTree_old/iDualTree2d_SplitHighLowComplex.m | 2,206 | utf_8 | 067dff0fa56487ccf60ae8205350bf8a | function [ y ] = iDualTree2d_SplitHighLowComplex( w, J, FS_fb1d, fb1d, u_hi, u_low )
%IDUALTREE2D_SPLITHIGHLOWCOMPLEX Summary of this function goes here
% Detailed explanation goes here
% Chenzhe
% Oct, 2015
w_new = w;
for ilevel = 1:J
for dir = 1:2
r_ind = dir;
i_ind = mod(dir, 2)+1;
... |
github | czdiao/DirMuRS_Simple-master | iDualTree2d_SplitHighLow.m | .m | DirMuRS_Simple-master/Transforms/time/DualTree_old/iDualTree2d_SplitHighLow.m | 3,347 | utf_8 | dfc3b7f05fc2c0869df80479c1ecf21e | function [ y ] = iDualTree2d_SplitHighLow( w, J, FS_fb1d, fb1d, u_hi, u_low )
%IDUALTREE2D_SPLITHIGHLOW Summary of this function goes here
% Detailed explanation goes here
%% old implementation
% u1_filter = [-0.60681876962335599886786626353146e0 -0.49991154192621583718062920651918e0 0.106907227697141973020036537465... |
github | czdiao/DirMuRS_Simple-master | DualTree2d_SplitHigh.m | .m | DirMuRS_Simple-master/Transforms/time/DualTree_old/DualTree2d_SplitHigh.m | 2,831 | utf_8 | 306bd56ca8ff1e5098e66a6ae95d746b | function [ w ] = DualTree2d_SplitHigh( x, J, FS_fb1d, fb1d, u_hi )
%DUALTREE2D_SPLITHIGH Summary of this function goes here
% Detailed explanation goes here
%% old implementation
% w = DualTree2d_new(x, J, FS_fb1d, fb1d);
%
% u1 = filter1d([-0.5, 0.5],-1);
% u2 = filter1d([-0.5, -0.5], -1);
%
% for j = 1:J
% f... |
github | czdiao/DirMuRS_Simple-master | DualTree2d_SplitHighLow.m | .m | DirMuRS_Simple-master/Transforms/time/DualTree_old/DualTree2d_SplitHighLow.m | 3,928 | utf_8 | a5107163211b47cb96a020c0eb780af7 | function [ w ] = DualTree2d_SplitHighLow( x, J, FS_fb1d, fb1d, u_hi, u_low )
%DUALTREE2D_SPLITHIGHLOW Summary of this function goes here
% Detailed explanation goes here
%% old implementation
% w = DualTree2d_SplitHigh(x, J, FS_fb1d, fb1d);
%
% u1_filter = [-0.60681876962335599886786626353146e0 -0.49991154192621583... |
github | czdiao/DirMuRS_Simple-master | DualTree2d_SplitHighLowComplex.m | .m | DirMuRS_Simple-master/Transforms/time/DualTree_old/DualTree2d_SplitHighLowComplex.m | 3,004 | utf_8 | bd90c4a8f667780522b9635c4b4d3999 | function [ w ] = DualTree2d_SplitHighLowComplex( x, J, FS_fb1d, fb1d, u_hi, u_low )
%DUALTREE2D_SPLITHIGHLOWCOMPLEX Summary of this function goes here
%
% Chenzhe
% Oct, 2015
w_orig = DualTree2d(x, J, FS_fb1d, fb1d);
w = cell(1, J+1);
for ilevel = 1:J
w{ilevel} = cell(1, 2);
% initialize memory
... |
github | czdiao/DirMuRS_Simple-master | iDualTree2d_SplitHigh.m | .m | DirMuRS_Simple-master/Transforms/time/DualTree_old/iDualTree2d_SplitHigh.m | 2,355 | utf_8 | c88297f5371462eb776a4582b335bc4d | function [ y ] = iDualTree2d_SplitHigh( w, J, FS_fb1d, fb1d, u_hi )
%IDUALTREE2D_SPLITHIGH Summary of this function goes here
% Detailed explanation goes here
%% old implementation
% u1 = filter1d([-0.5, 0.5],-1);
% u2 = filter1d([-0.5, -0.5], -1);
%
% for j = 1:J
% for m = 1:2
% for n = 1:2
% ... |
github | czdiao/DirMuRS_Simple-master | keeplocalcoeff.m | .m | DirMuRS_Simple-master/Transforms/time/@DualTreeWavelet2D/keeplocalcoeff.m | 1,054 | utf_8 | 4185a1f722ebc21308590cffa4b121e9 | function [ coeff ] = keeplocalcoeff( obj, Ind )
%KEEPLOCALCOEFF Keep the wavelet coeff corresponding to the specific
%pixel location.
%Input:
% Ind:
% Index Matrix, of the same size as the original image. This should
% be logical matrix (0-1 type). 1 indicate all wavelet coeff
% coresponding to this... |
github | czdiao/DirMuRS_Simple-master | reconstruction.m | .m | DirMuRS_Simple-master/Transforms/time/@DualTreeSplitHighLow2D/reconstruction.m | 1,900 | utf_8 | 4238f1582bb6ba82cf19f84f7dd657b4 | function y = reconstruction( obj )
%RECONSTRUCTION Wavelet Reconstruction function
%
% This function is the inverse of 2D DT-CWT with Split Hipass and lowpass
%
% This version is called 'real', we require obj.u_hi and obj.u_low
% to be both real filter banks.
%
% Chenzhe
% Jan, 2016
%
w = obj.coeff;
J = obj.... |
github | czdiao/DirMuRS_Simple-master | decomposition.m | .m | DirMuRS_Simple-master/Transforms/time/@DualTreeSplitHighLow2D/decomposition.m | 2,187 | utf_8 | 76d18b261f3c2bb76bb7572361c0e0f2 | function w = decomposition( obj, x )
%DECOMPOSITION Wavelet decomposition function
%
% This is 2D DT-CWT with Split the highpass and lowpass
%
% This version is called 'real', we require obj.u_hi and obj.u_low
% to be both real filter banks.
%
% Chenzhe
% Jan, 2016
J = obj.nlevel;
FS_fb1d = obj.FirstStageFB... |
github | czdiao/DirMuRS_Simple-master | reconstruction.m | .m | DirMuRS_Simple-master/Transforms/time/@DualTreeSplitHighLowComplex2D/reconstruction.m | 2,375 | utf_8 | dacb2916a7ef998e9d6f221c576b41e4 | function y = reconstruction( obj )
%RECONSTRUCTION Wavelet Reconstruction function
%
% This function is the inverse of 2D DT-CWT with Split Hipass and lowpass
%
% This version is called 'complex', we can accept obj.u_hi or
% obj.u_low to be complex filter banks.
%
% Chenzhe
% Jan, 2016
%
w = obj.coeff;
J = o... |
github | czdiao/DirMuRS_Simple-master | decomposition.m | .m | DirMuRS_Simple-master/Transforms/time/@DualTreeSplitHighLowComplex2D/decomposition.m | 3,161 | utf_8 | fcebeb067bfaf45b742dc90b82af743a | function w = decomposition( obj, x )
%DECOMPOSITION Wavelet decomposition function
%
% This is 2D DT-CWT with Split the highpass and lowpass
%
% This version is called 'complex', can accept obj.u_hi or
% obj.u_low to be complex filter banks.
%
% Chenzhe
% Jan, 2016
J = obj.nlevel;
u_hi = obj.u_hi;
u_low = o... |
github | czdiao/DirMuRS_Simple-master | ifDualTree2d_SplitHighLow.m | .m | DirMuRS_Simple-master/Transforms/frequency/ifDualTree2d_SplitHighLow.m | 2,219 | utf_8 | 14200b4be6d81d5b493456754247aef1 | function [ y ] = ifDualTree2d_SplitHighLow( w, J, FS_fb1d, fb1d )
%IFDUALTREE2D_SPLITHIGHLOW Summary of this function goes here
% Detailed explanation goes here
%% To Split Lowpass filters
len = 2*length(w{1}{1}{1}{1});
[u1, u2] = SplitLowOrig;
u1_low = u1.convert_ffilter(len);
u2_low = u2.convert_ffilter(len);
%... |
github | czdiao/DirMuRS_Simple-master | fDualTree2d_SplitHighLow.m | .m | DirMuRS_Simple-master/Transforms/frequency/fDualTree2d_SplitHighLow.m | 2,605 | utf_8 | a6262b0ee0bc95c2ea8a02dee0869702 | function [ w ] = fDualTree2d_SplitHighLow( x, J, FS_fb1d, fb1d )
%FDUALTREE2D_SPLITHIGHLOW Summary of this function goes here
% Detailed explanation goes here
%% To Split Lowpass filters
[u1, u2] = SplitLowOrig;
u1_low = u1.convert_ffilter(length(x));
u2_low = u2.convert_ffilter(length(x));
% len = length(x);
% u1... |
github | czdiao/DirMuRS_Simple-master | ifDualTree2d_SplitHigh.m | .m | DirMuRS_Simple-master/Transforms/frequency/ifDualTree2d_SplitHigh.m | 1,445 | utf_8 | e8e805fce96b8b112e364942201ccef4 | function [ y ] = ifDualTree2d_SplitHigh( w, J, FS_fb1d, fb1d )
%IFDUALTREE2D_SPLITHIGH Summary of this function goes here
% Detailed explanation goes here
%% Directly
u1 = filter1d([-0.5, 0.5],-1);
u2 = filter1d([-0.5, -0.5], -1);
len = 2*length(w{1}{1}{1}{1});
u1 = u1.convert_ffilter(len);
u2 = u2.convert_ffilt... |
github | czdiao/DirMuRS_Simple-master | fDualTree2d_SplitHigh.m | .m | DirMuRS_Simple-master/Transforms/frequency/fDualTree2d_SplitHigh.m | 1,629 | utf_8 | 3a0b8cfeaffb51b35197dc2fc0b32d83 | function [ w ] = fDualTree2d_SplitHigh( x, J, FS_fb1d, fb1d )
%FDUALTREE2D_SPLITHIGH Summary of this function goes here
% Detailed explanation goes here
%% Directly
[u1, u2] = SplitHaar;
u1 = u1.convert_ffilter(length(x));
u2 = u2.convert_ffilter(length(x));
x = fft2(x);
w = cell(1, J+1);
x = x/2; ... |
github | czdiao/DirMuRS_Simple-master | GSMDenoise.m | .m | DirMuRS_Simple-master/Transforms/frequency/@TPCTF2D/GSMDenoise.m | 2,215 | utf_8 | 85f5a31a2dbebd98af6bf7e62ee66ef6 | function W = GSMDenoise( obj, blocksize, Cwr, Cwi, sigmaN )
%GSMDENOISE Denoising in wavelet domain based on GSM model
%
% This is performed without parent information.
%
% Currently for TPCTF transform only, GSM is performed to real/imag part of the
% coeff separately.
%
%Input:
% blocksize:
% integer.... |
github | czdiao/DirMuRS_Simple-master | reconstruction.m | .m | DirMuRS_Simple-master/Transforms/frequency/@fFrameletCrossLv2D/reconstruction.m | 1,610 | utf_8 | 3705e2d4d60bc22bcf9923bfb55ec21d | function [ y ] = reconstruction( obj )
%RECONSTRUCTION Reconstruction of fFrameletCrossLv2D
%
%
% Chenzhe
% Mar, 2016
%
FfilterBank_col = obj.FilterBank_col;
FfilterBank_row = obj.FilterBank_row;
w = obj.coeff;
w = obj.wfft2(w); % Change the coeff into frequency domain
J = obj.nlevel;
LL = w{J+1};
for ilevel ... |
github | czdiao/DirMuRS_Simple-master | decomposition.m | .m | DirMuRS_Simple-master/Transforms/frequency/@fFrameletCrossLv2D/decomposition.m | 1,494 | utf_8 | 1fd3c9229db9cb4315d8c407374ece7c | function w = decomposition( obj, x )
%DECOMPOSITION Decomposition of fFrameletCrossLv2D class
%
% Chenzhe
% Mar, 2016
%
fdata = fft2(x); % Change the data into frequency domain
nL = obj.nlevel;
FB_col = obj.FilterBank_col;
FB_row = obj.FilterBank_row;
ncol = length(FB_col);
nrow = length(FB_row);
w = cell(1, n... |
github | czdiao/DirMuRS_Simple-master | Angular_FilterBank_freq2D.m | .m | DirMuRS_Simple-master/Filters/FreqFilterBank2D/Angular_FilterBank_freq2D.m | 7,384 | utf_8 | 2d2fb45a2c006d8f742f584f049c8030 | function [ fb2d ] = Angular_FilterBank_freq2D( Rl, Lv, K, N )
%ANGULAR_FILTERBANK_FREQ2D 2D Frequency filter bank in angular partition.
%
% Called by GenAngular_FB_freq2D_disk() and GenAngular_FB_freq2D_gaussian()
%
%Input:
% Rl:
% Array for partition point of R. Length = L for L*K hipass
% Lv:
% Leve... |
github | czdiao/DirMuRS_Simple-master | Square_FilterBank_freq2D.m | .m | DirMuRS_Simple-master/Filters/FreqFilterBank2D/Square_FilterBank_freq2D.m | 3,459 | utf_8 | 0bb1cd8758718dbd673b2f2758f7ac13 | function [ fb2d ] = Square_FilterBank_freq2D( C, Lv, N )
%SQUARE_FILTERBANK_FREQ2D Frequency filter bank in angular partition.
%
% Called by GenSquare_FB_freq2D_average()
%
%Input:
% C:
% Array for partition point in (0, pi).
% Lv:
% Number of Scales. We construct the higher level filters directly by
... |
github | linxichen/dmp_dsge-master | nested_timeiter_obj.m | .m | dmp_dsge-master/PEA/nested_timeiter_obj.m | 2,531 | utf_8 | 26b545f8eb8b3f5c0e137b4fa73194a7 | function [x,fval,exitflag] = nested_timeiter_obj(state,param,coeff_lnmh,coeff_lnmf,epsi_nodes,weight_nodes,n_nodes,x0,options)
% Call fmincon
[x,fval,exitflag] = fsolve(@eulers,x0,options);
function [residual] = eulers(control)
% load parameters
bbeta = param(1); % 1
ggamma = param(2); % 2
kkappa = param(3); % 3
eeta ... |
github | linxichen/dmp_dsge-master | nested_obj.m | .m | dmp_dsge-master/PPI/nested_obj.m | 2,243 | utf_8 | 85582a7045403276511ed93d70a6460b | function [x,fval,exitflag] = nested_obj(state,param,pphi,epsi_nodes,weight_nodes,n_nodes,x0,lb,ub,options);
% Call fmincon
[x,fval,exitflag] = fmincon(@obj,x0,[],[],[],[],lb,ub,@pos_constraint,options);
function [c,ceq] = pos_constraint(control)
% This function calculates implied consumption and vacancy value such tha... |
github | linxichen/dmp_dsge-master | tauchen.m | .m | dmp_dsge-master/tools/tauchen.m | 1,568 | utf_8 | 79e083b5a0bb531af0ef5e11c05d58d2 | function [Z,Zprob] = tauchen(N,mu,rho,sigma,m)
%Function TAUCHEN
%
%Purpose: Finds a Markov chain whose sample paths
% approximate those of the AR(1) process
% z(t+1) = (1-rho)*mu + rho * z(t) + eps(t+1)
% where eps are normal with stddev sigma
%
%Format: {Z, Zprob} = Tauchen... |
github | linxichen/dmp_dsge-master | ChebyshevPoly.m | .m | dmp_dsge-master/tools/ChebyshevPoly.m | 799 | utf_8 | 8c63f1e80b8e93c61ba26a4ed51b9da0 |
% ChebyshevPoly.m by David Terr, Raytheon, 5-10-04
% Given nonnegative integer n, compute the
% Chebyshev polynomial T_n. Return the result as a column vector whose mth
% element is the coefficient of x^(n+1-m).
% polyval(ChebyshevPoly(n) ,x) evaluates T_n(x).
function tk = ChebyshevPoly(n)
if n==0
... |
github | linxichen/dmp_dsge-master | hpfast.m | .m | dmp_dsge-master/tools/hpfast.m | 3,893 | utf_8 | af24f7b5b0f139ea139bc61a8f96f9d9 | % ---------------------------------------------------------------------%
% SUBROUTINE HPFILT: %
% Kalman smoothing routine for HP filter written by E Prescott. %
% y=data series, d=deviations from trend, t=trend, n=no. obs, %
% s=smoothing ... |
github | linxichen/dmp_dsge-master | gen_hermite_rule.m | .m | dmp_dsge-master/tools/gen_hermite_rule.m | 30,937 | utf_8 | 3ef21947d0772568d90156675b22dc66 | function gen_hermite_rule ( order, alpha, a, b, filename )
%*****************************************************************************80
%
%% GEN_HERMITE_RULE generates a Gauss-Hermite rule.
%
% Discussion:
%
% This program computes a standard or exponentially weighted
% generalized Gauss-Hermite quadrature... |
github | jkperin/optical-comm-master | build_simulation.m | .m | optical-comm-master/gui/build_simulation.m | 7,181 | utf_8 | 909f17237feb38857b9befdc0b6f32ff | function [mpam, ofdm1, tx, fiber1, soa1, apd1, rx, sim] = build_simulation(h)
%% Extract user-inputted values from GUI and build required classes and structs
% Auxiliary functions
getString = @(h) get(h, 'String');
getValue = @(h) str2double(get(h, 'String'));
getLogicalValue = @(h) logical(get(h, 'Value'));
%% Simul... |
github | jkperin/optical-comm-master | sim_single_laser.m | .m | optical-comm-master/gui/sim_single_laser.m | 40,655 | utf_8 | 550c55ce86f5cd8bed428aa8b027b7cf | function sim_single_laser
%% Main file of GUI. Creates layout and handle events.
clc, close all
% Used folders
addpath f
addpath data/
addpath ../f % general functions
addpath ../mpam
addpath ../soa
addpath ../soa/f
addpath ../apd
addpath ../apd/f
addpath ../ofdm
ad... |
github | jkperin/optical-comm-master | ofdm_pp_vs_mod_cutoff.m | .m | optical-comm-master/gui/f/ofdm_pp_vs_mod_cutoff.m | 3,124 | utf_8 | 17f9b96e8f92e939e5b7a1e936ba73a3 | %% Power penalty vs modulator cutoff frequency
function pp = ofdm_pp_vs_mod_cutoff(ofdm, tx, fiber, rx, sim)
% Transmitter filter (ZOH + some smoothing filter)
tx.filter = design_filter('bessel', 5, 1/(ofdm.Ms*sim.Mct));
% Convolve with ZOH
bzoh = ones(1, sim.Mct)/sim.Mct;
tx.filter.num = conv(tx.filter.num, bzoh);
t... |
github | jkperin/optical-comm-master | sim_setup.m | .m | optical-comm-master/gui/ads/sim_setup.m | 589 | utf_8 | fda5ff0747f92c5420d44fa9e38f46fa | %% Matlab Setup
function [out1, out2] = sim_setup(in1, in2, in3)
persistent n
if isempty(n)
n = 1;
end
global Anode Pout Poutnf
% CodesPath = 'C:\Users\jose.krauseperin\Documents\codes';
%
% addpath([CodesPath '\f\'])
% addpath([CodesPath '\mpam\'])
% addpath([CodesPath '\ofdm\'])
% addpath([CodesPath '\apd\']... |
github | jkperin/optical-comm-master | sim_level_spacing_optimization.m | .m | optical-comm-master/soa/sim_level_spacing_optimization.m | 6,456 | utf_8 | 2c4bdbf6d06e654dbb6c1b934522fefa | %% Simulations for SOA with equally-spaced and optimized level spacing compared with Gaussian approximation
function sim_level_spacing_optimization
close all, clc
format compact
addpath ../f % general functions
addpath ../mpam
addpath ../soa
addpath ../soa/f
M = [4 8];
FndB = 3:10;
Colors = {'k', 'b', 'r', 'g'};
... |
github | jkperin/optical-comm-master | req_Ptx_vs_noise_figure.m | .m | optical-comm-master/soa/req_Ptx_vs_noise_figure.m | 5,892 | utf_8 | 790291f39e02747129b1593aa2449e94 | %% Required Transmitted power vs amplifier noise figure
function req_Ptx_vs_Fn()
clc, close all
addpath ../mpam/
addpath ../f % general functions
addpath f
%% Parameters to swipe
M = [4 8 16]; % PAM order
Fn = 3:10; % Noise figure
GainsdB = 20; % Gain in dB
for m = 1:length(M)
fprintf('------- %d-PAM\n (with pol... |
github | jkperin/optical-comm-master | klse_freq.m | .m | optical-comm-master/soa/f/klse_freq.m | 2,240 | utf_8 | 119a81ab0b705f71113334bd8b32f5f6 | % Calculate eigenvalues D and eigenfunctions Phi of the KL series expansion
% in the frequency domain.
% KWPhi = PhiD
% where K(vn, vm) = Ho(vn)He(vn-vm)Ho(vm), and W is a diagonal matrix of
% the weights of the Gauss-Legendre quadrature rule.
% Columns of Phi are orthornormal.
function [D, Phi, Fmax, nu] = klse_fre... |
github | jkperin/optical-comm-master | ber_soa_klse_freq.m | .m | optical-comm-master/soa/f/ber_soa_klse_freq.m | 4,965 | utf_8 | 42029187e8dbab5b097e79943aae5e82 | %% Calculate BER for amplified IM-DD link
% bertail = calculate BER using saddlepoint approximation for the tail
% probability. Can't be innacurate because of singularity at origin.
% However, it's much faster
% berpdf (optional) = calculate BER using saddlepoint approximation for the
% pdf, and then calculate tail pro... |
github | jkperin/optical-comm-master | klse_fourier.m | .m | optical-comm-master/soa/f/klse_fourier.m | 4,855 | utf_8 | aa0c989a047bb18dd38683603972a8ac | %% KLSE Fourier Series Expansion
% Calculate eigenvectors and eigenvalues for KLSE Fourier Series Expansion
% Both noise and signal are expanded on the same basis.
% N = sequence length
% Hdisp (optional) = dispersion frequency response
function [U, D, Fmax] = klse_fourier(rx, sim, N, Hdisp)
%% Expansion using same b... |
github | jkperin/optical-comm-master | ber_soa_klse_fourier.m | .m | optical-comm-master/soa/f/ber_soa_klse_fourier.m | 6,674 | utf_8 | b94b5c70c82fc0421ad2c44479a1c334 | %% Calculate BER for amplified IM-DD link
%% Shot and RIN are not included even if sim.RIN and sim.shot == true.
%% Signal-spontaenous noise is assumed to be dominant followed by thermal noise
% bertail = BER using saddlepoint approximation for the tail probability.
% Although it's much faster than using the pdf, it ... |
github | jkperin/optical-comm-master | tail_saddlepoint_approx.m | .m | optical-comm-master/soa/f/tail_saddlepoint_approx.m | 2,417 | utf_8 | c48d8e809b698a2cae975dd15e46c1fe | %% Calculate tail probability of a random variable generated by the weighted sum of
%% N noncentral chi square with 2 degrees of freedom and a Guassian r.v.
% Input:
% P(X > x)
% D (Nx1) = weights of noncentral chi square with 2 degrees of freedom.
% xn (N x Nsymb) = equivalent to noncetrality parameter of individual ... |
github | jkperin/optical-comm-master | pdf_saddlepoint_approx.m | .m | optical-comm-master/soa/f/pdf_saddlepoint_approx.m | 2,384 | utf_8 | 069dac1965c6b8cd340e7bcdf2864db9 | %% Calculate pdf of a random variable generated by the weighted sum of
%% N noncentral chi square with 2 degrees of freedom and a Guassian r.v.
% Input:
% pX(x)
% D (Nx1) = weights of noncentral chi square with 2 degrees of freedom.
% xn (N x Nsymb) = used to calculate the noncetrality parameter of individual chi squa... |
github | jkperin/optical-comm-master | ber_soa_montecarlo.m | .m | optical-comm-master/soa/f/ber_soa_montecarlo.m | 3,143 | utf_8 | 1e33511817360c915085b8e929e1464d | %% Calculate BER of amplified IM-DD system through montecarlo simulation
function ber = ber_soa_montecarlo(mpam, tx, fiber, soa, rx, sim)
% Normalized frequency
f = sim.f/sim.fs;
%% Channel response
% Hch does not include transmitter or receiver filter
if isfield(tx, 'modulator')
Hch = tx.modulator.H(sim.f).*exp(... |
github | jkperin/optical-comm-master | level_spacing_optm.m | .m | optical-comm-master/soa/f/level_spacing_optm.m | 2,906 | utf_8 | 7cd2323592489f7e66e618d0fe773bae | %% Level spacing (a) and decision threshold (b) optmization
% Assumes infinite extinction ratio at first, then corrects power and
% optmize levels again
% The calculated levels and thresholds are at the receiver
function [a, b] = level_spacing_optm(mpam, tx, soa, rx, sim)
if isfield(sim, 'polarizer') && ~sim.polarizer... |
github | jkperin/optical-comm-master | Weiner.m | .m | optical-comm-master/coherent/f/Weiner.m | 7,497 | utf_8 | f11434d6e09a5280726eb70ed1dd445f | function W = Weiner()
close all
l0 = 12;
k = 50;
N0 = 2.0768e-016;
[a_ii ~] = Ql(l0,l0,k,k,0);
a_ii = conj(a_ii');
a = [a_ii,zeros(size(a_ii));zeros(size(a_ii)),a_ii];
A_ii = zeros(size(a_ii,1),size(a_ii,1));
for l=1:24;
for n=(k-5):(k+5)
[q,p] = Ql(l0,l,k,n,0);
... |
github | jkperin/optical-comm-master | calcDSPOperations.m | .m | optical-comm-master/coherent/f/calcDSPOperations.m | 6,248 | utf_8 | 8c5a16e2da86bd372f40112de6fc866f | function [Nsum, Nmult] = calcDSPOperations(Rx, sim)
Npol = 2; % number of polarizations
%% Equalization
eq.Nsum = 0;
eq.Nmult = 0;
if strcmpi(Rx.AdEq.structure, '2 filters')
Nfilters = 2;
[eq.Nsum, eq.Nmult] = countFIR(Nfilters, eq.Nsum, eq.Nmult, Rx.AdEq.Ntaps);
[eq.Nsum, eq.Nmult] = countComplexMult(2, ... |
github | jkperin/optical-comm-master | wiener_fir.m | .m | optical-comm-master/coherent/f/wiener_fir.m | 1,058 | utf_8 | b47b2a0782b3e9c405d8d8a6b9febd78 | % Computes the coefficients of the L-point Wiener filter
% W = inv(R)*P
% The system is assumed to be of the form:
% theta(k) = theta(k-Delta) + (theta(k)-theta(k-Delta)) + n'(k)
% where phase theta evolves as a Wiener process with
% E[(theta(k)-theta(k-l))^2] = sigmapsq*|l|
% n'(k) is additive white Gaussian noise wit... |
github | jkperin/optical-comm-master | analog_time_recovery.m | .m | optical-comm-master/coherent/analog/analog_time_recovery.m | 7,087 | utf_8 | 8d0e7e7e8816ca690a70317cd03b964f | function [ysamp, idx, Ndiscard] = analog_time_recovery(yct, TimeRec, sim, verbose)
%% Time recovery for analog-based receiver
% Inputs:
% - yc: input signal in "continuous-time". If yct is complex, ony the I
% component will be used for estimating the clock.
% - TimeRec: struct containing time recovery method properti... |
github | jkperin/optical-comm-master | optical_modulator.m | .m | optical-comm-master/f/optical_modulator.m | 1,994 | utf_8 | 77739301306f443d9c456e81691bb1e5 | % 1. frequency response
% 2. Modulator nonlinearity (not implemented)
% 3. Adds intensity noise (if sim.RIN = true)
% 4. Adds chirp if tx.alpha is defined
function [Et, Pt] = optical_modulator(xt, tx, sim)
%% Apply frequency response of the modulator
if isfield(tx, 'modulator') % if frequency response is defin... |
github | jkperin/optical-comm-master | GN_model_coeff.m | .m | optical-comm-master/f/GN_model_coeff.m | 3,148 | utf_8 | 8d44cf1c5292f9f3ead1014e9620f484 | function D = GN_model_coeff(lamb, Df, Fiber, l)
%% Compute Gaussian noise (GN) model coefficients
% These coefficients assume number of spans = 1
% Inputs:
% - lamb: vector of wavelengths. Wavelengths are given in m
% - Df: channel spacing in Hz
% - Fiber: instance of class fiber correspoding to... |
github | jkperin/optical-comm-master | calc_besself_cutoff.m | .m | optical-comm-master/f/calc_besself_cutoff.m | 781 | utf_8 | 91dc37b89a2edfe21f183cf7d9838354 | %% Function used to determine the conversion factor between cutoff frequency and w0, which is the input parameter of the matlab function besself
% The wo parameter in Bessel filter design is the frequency up to which the
% filter's group delay is approximately constant.
% Example:
% [x, fval] = fzero(@(x) calc_bessel... |
github | jkperin/optical-comm-master | ndhist.m | .m | optical-comm-master/f/ndhist.m | 4,356 | utf_8 | 6d27910dcfcf7881e0d18b82a9215138 | function qHist = ndhist(varargin)
%function qHist = ndhist(mData, vEdge1, vEdge2, ..., vEdgen)
%Finds n-dimensional histogram data cube
%**Arguments**
% mData : [# Data points, # dimension] table of data points that you want to calcuate its histogram
% vEdge* : Edge for each dimension
%**Return value**
% qHist... |
github | jkperin/optical-comm-master | improve_plot.m | .m | optical-comm-master/f/improve_plot.m | 570 | utf_8 | a9dd60dd737cf8ea7cb7cb5c582e6f7e | function improve_plot(h, other)
children = allchild(h);
for k = 1:length(children)
children(k).LineWidth = 2;
end
set(h, 'box', 'on')
set(h, 'FontSize', 12)
xl = get(h, 'xlabel');
xl.FontSize = 12;
yl = get(h, 'ylabel');
yl.FontSize = 12;
if exist('other', 'var')
if iscell(other)
for k = 1:length(oth... |
github | jkperin/optical-comm-master | freqshift.m | .m | optical-comm-master/f/freqshift.m | 337 | utf_8 | 73b7cffd420e96665b878b366f865438 | % freqshift.m Joseph M. Kahn 12/6/11
% Shifts a vector signal by frequency fshift.
% x: input signal (two-row matrix)
% t: time (one-row vector)
function xshift = freqshift(x,t,fshift)
%xshift = [x(1,:).*exp(sqrt(-1)*2*pi*fshift*t); x(2,:).*exp(sqrt(-1)*2*pi*fshift*t)];
xshift = x.*repmat(exp(1j*2*pi*fshift*t),s... |
github | jkperin/optical-comm-master | debruijn_sequence.m | .m | optical-comm-master/f/debruijn_sequence.m | 42,327 | utf_8 | f8ee811b3accf07f0b55d679e6e2a5c6 | %% Precalculated De Bruijn sequence with subsequence length n for the alphabet = {0, 1, ..., M-1}
% Sequences were calculated using Mathematica: DeBruijnSequence[a, n]
% M = 2, 4, 8, or 16
% n = 1, 2, 3, 4, 5
function sequence = debruijn_sequence(M, n)
try
switch n
case 1
sequence2 = 0:1;
... |
github | jkperin/optical-comm-master | design_filter.m | .m | optical-comm-master/f/design_filter.m | 10,281 | utf_8 | c8063ba05bef6ad540bd301203e69409 | %% Design filters. See validate_design_filter.m
% Continuous-time filters are designed in continuous time and then
% converted to discrete time using bilinear transformation with frequency
% prewarping. If oversampling ratio of 'continuous time' (Mct) is high enough
% approximation will be accurate.
% Gaussian and FBG... |
github | jkperin/optical-comm-master | validate_nonlinear_noise_gradient.m | .m | optical-comm-master/f/validate_nonlinear_noise_gradient.m | 2,921 | utf_8 | ff40eed7ac7925f32f601a2fda088618 | function validate_nonlinear_noise_gradient()
%% Validate gradient calculations
clear, close all
S = load('../edfa/results/capacity_vs_pump_power_PdBm/capacity_vs_pump_power_EDF=principles_type3_pump=60mW_980nm_L=286_x_50km.mat');
E = S.Eopt{S.kopt};
Signal = S.Sopt{S.kopt};
Pump = S.Pump;
problem = S.problem;
problem... |
github | jkperin/optical-comm-master | ber_ofdm.m | .m | optical-comm-master/ofdm/ber_ofdm.m | 9,538 | utf_8 | 8640cf469fe46079107905baa217ded9 | function [ber, ofdm, OSNRdB] = ber_ofdm(ofdm, Tx, Fibers, Rx, sim)
%% Calculate BER of DC or ACO-OFDM in IM-DD system
% This function calculates appropriate cyclic prefix length given the
% channel memory length. It calls ber_dc_ofdm_montecarlo, which performs
% Montecarlo simulation to obtain the BER at each transmitt... |
github | jkperin/optical-comm-master | OFDM_BER_qsub.m | .m | optical-comm-master/ofdm/OFDM_BER_qsub.m | 6,790 | utf_8 | 17a4af90016311d19ec2ef05f568bfae | %% Evaluation of OFDM in IM-DD system, which may be amplified or not
function BER = OFDM_BER_qsub(OFDMtype, Amplified, fiberLengthKm, ModBWGHz, ENOB)
addpath f/
addpath ../f/
addpath ../apd/
filename = sprintf('results/%s_BER_Amplified=%s_L=%skm_ModBW=%sGHz_ENOB=%s.mat',...
OFDMtype, Amplified, fiberLengthKm,... |
github | jkperin/optical-comm-master | Levin_Campello_MA.m | .m | optical-comm-master/ofdm/f/Levin_Campello_MA.m | 3,573 | utf_8 | d5f38d3b6aed47fdab71653c710295e0 | %% Calculate Levin-Campello algorithm for Margin-Adaptive (MA) problem
% This is the optimal solution for the problem of minimizing the required
% signal power to achieve a fixed bit rate B
%% input:
% B = fixed bit rate
% beta = Information Granularity: is the smallest incremental unit of information that can be trans... |
github | jkperin/optical-comm-master | spectrum_periodogram.m | .m | optical-comm-master/ofdm/examples/project 1/spectrum_periodogram.m | 248 | utf_8 | 0cad359ec65fa1968d9502b517c73247 | % Given signal x, compute the spectrum Sxx using a periodogram with block size Nb
function Sxx = spectrum_periodogram(x,Nb)
N = length(x);
M = floor(N/Nb);
Sxx = zeros(1,Nb);
for m = 0:M-1
Sxx = Sxx + (1/M)*abs(fft(x(m*Nb+[1:Nb]))).^2;
end; |
github | jkperin/optical-comm-master | matlab2tikzInputParser.m | .m | optical-comm-master/ofdm/figs/matlab2tikzInputParser.m | 9,337 | windows_1250 | 6b5ca01090f83ca98df031f4024feb48 | function parser = matlab2tikzInputParser()
%MATLAB2TIKZINPUTPARSER Input parsing for matlab2tikz..
% This implementation exists because Octave is lacking one.
% Copyright (c) 2008--2014 Nico Schlömer
% All rights reserved.
%
% Redistribution and use in source and binary forms, with or without
% modificatio... |
github | jkperin/optical-comm-master | matlab2tikz.m | .m | optical-comm-master/ofdm/figs/matlab2tikz.m | 220,240 | utf_8 | c5098d97aafbae5259a03bef2480ac9b | function matlab2tikz(varargin)
%MATLAB2TIKZ Save figure in native LaTeX (TikZ/Pgfplots).
% MATLAB2TIKZ() saves the current figure as LaTeX file.
% MATLAB2TIKZ comes with several options that can be combined at will.
%
% MATLAB2TIKZ(FILENAME,...) or MATLAB2TIKZ('filename',FILENAME,...)
% stores the LaTeX code... |
github | jkperin/optical-comm-master | updater.m | .m | optical-comm-master/ofdm/figs/updater.m | 5,723 | windows_1250 | 8820599196c3d2783f54113d40689aa4 | function updater(name, fileExchangeUrl, version, verbose, env)
%UPDATER Auto-update matlab2tikz.
% Only for internal usage.
% Copyright (c) 2012--2014, Nico Schlömer <nico.schloemer@gmail.com>
% All rights reserved.
%
% Redistribution and use in source and binary forms, with or without
% modification, are ... |
github | jkperin/optical-comm-master | apd_.m | .m | optical-comm-master/apd/trash/apd_.m | 1,731 | utf_8 | 6d23fb23e2ebe99108b356ed32acff29 | % Calculate detected current of realistic apd
% Inputs:
% Pt = power at instant t
% dt = sampling interval of Pt
% tx = struct of transmitter (tx.lamb)
% rx = struct of apd (rx.R, rx.k, rx.Gapd)
% Outputs:
% Irx = detected current corresponding to Pt
% v = number of primary electrons generated
% g = number of secondar... |
github | jkperin/optical-comm-master | apd_doubly_stochastic.m | .m | optical-comm-master/apd/trash/apd_doubly_stochastic.m | 3,581 | utf_8 | f1180bbb1b49c5bca08237073cb3786f | % Calculate detected current of realistic apd
% Inputs:
% Pt = power at instant t
% dt = sampling interval of Pt
% tx = struct of transmitter (tx.lamb)
% rx = struct of apd (rx.R, rx.k, rx.Gapd)
% Outputs:
% Irx = detected current corresponding to Pt
% v = number of primary electrons generated
% g = number of secondar... |
github | jkperin/optical-comm-master | apd_gain_distribution.m | .m | optical-comm-master/apd/trash/apd_gain_distribution.m | 1,169 | utf_8 | 597370d82f49a227c4d522cd54b782e3 | % Gain distribution
% n = primary, r = secondary
% pnnr = p(n|n + r)
function pnnr = apd_gain_distribution(n, keff, Gapd)
%
% prv = @(v, r) v*((1-keff)*(Gapd-1)/Gapd).^(r-v).*gamma(r/(1-keff)).*((1 + keff*(Gapd-1))/Gapd).^((v+keff*(r-v))/(1-keff))./...
% ((v + keff*(r-v)).*factorial(r-v).*((v + keff*(r-v))/(1-keff... |
github | jkperin/optical-comm-master | test_gain_gradient.m | .m | optical-comm-master/edfa/validation/test_gain_gradient.m | 1,962 | utf_8 | 53a732ae07d3414d1811455a11826d8a | %% Test gain gradient
function test_gain_gradient()
%% Validate gradient calculations
clear, clc, close all
addpath ../
addpath ../../f
S = load('../results/capacity_vs_pump_power_PdBm/capacity_vs_pump_power_EDF=principles_type3_pump=60mW_980nm_L=286_x_50km.mat');
E = S.Eopt{S.kopt};
Signal = S.Sopt{S.kopt};
Pump = ... |
github | gmaze/gmaze_legacy-master | extract_subdomain.m | .m | gmaze_legacy-master/OCCA/Tlayer_budget/step1/extract_subdomain.m | 30,213 | utf_8 | 5264f0982b35098dd4268d9cc0cf0789 | % [] = extract_subdomain(LIST)
%
% This function extracts a 3D subdomain of OCCA 1x1 fields to be used in the
% thermal volume budget fortran code
%
% LIST may contain:
%
% 1: theta and volume elements
% 2: Tend. Native
% 3: Tend. Artif
% 4: Air-sea flux
% 5: All others (ssh, gtabt, ghatt)
% 6: total advection
% 7: t... |
github | gmaze/gmaze_legacy-master | check_jobs.m | .m | gmaze_legacy-master/OCCA/Tlayer_budget/extra/check_jobs.m | 8,667 | utf_8 | a126068e663c236594e6dbef0dfc97c9 | % [] = check_jobs([email])
%
% Draw a small report on running jobs
% This routine relies on the default package !
% If an email is specified, output are printed into
% the text file: jobs_report.txt and sent by email
%
% Created by Guillaume Maze on 2008-10-27.
% Copyright (c) 2008 Guillaume Maze.
% http://codes.guil... |
github | gmaze/gmaze_legacy-master | compute_EKL.m | .m | gmaze_legacy-master/matlab/MIT/compute_EKL.m | 3,771 | utf_8 | 3b98f77c0a20802127e6daca42a2e487 | %
% [EKL] = compute_EKL(SNAPSHOT)
%
% Here we compute the Ekmal Layer Depth as:
% EKL = 0.7 sqrt( |TAU|/RHO )/f
%
% where:
% TAU is the amplitude of the surface wind-stress (N/m2)
% RHO is the density of seawater (kg/m3)
% f is the Coriolis parameter (kg/m3)
% EKL is the Ekman layer depth (m)
%
% Files names are:
... |
github | gmaze/gmaze_legacy-master | compute_alpha.m | .m | gmaze_legacy-master/matlab/MIT/compute_alpha.m | 3,569 | utf_8 | 0d4cbf19f341afb78cee418016b2acf2 | %
% [ALPHA] = compute_alpha(SNAPSHOT)
%
% This function computes the thermal expansion coefficient from
% files of potential temperature THETA and salinity anomaly
% SALTanom.
% SALTanom is by default a salinity anomaly vs 35PSU.
% If not, (is absolute value) set the global variable is_SALTanom to 0
%
% Files name are... |
github | gmaze/gmaze_legacy-master | compute_JFz.m | .m | gmaze_legacy-master/matlab/MIT/compute_JFz.m | 6,044 | utf_8 | 5b55b4055b18fe35e7f26c409975ba76 | %
% [JFz] = compute_JFz(SNAPSHOT)
%
% Here we compute the PV flux due to frictionnal forces as
% JFz = ( TAUx * dSIGMATHETA/dy - TAUy * dSIGMATHETA/dx ) / RHO / EKL
%
% where:
% TAU is the surface wind-stress (N/m2)
% SIGMATHETA is the potential density (kg/m3)
% RHO is the density (kg/m3)
% EKL is the Ekman layer ... |
github | gmaze/gmaze_legacy-master | compute_QEk.m | .m | gmaze_legacy-master/matlab/MIT/compute_QEk.m | 3,929 | utf_8 | e754ea0dd0c568e042446bf3196fee76 | %
% [QEk] = compute_QEk(SNAPSHOT)
%
% Here we compute the lateral heat flux induced by Ekman currents
% from JFz, the PV flux induced by frictional forces:
% QEk = - Cw * EKL * JFz / alpha / f
% where:
% Cw = 4187 J/kg/K is the specific heat of seawater
% EKL is the Ekman layer depth (m)
% JFz is the PV flux (kg/m3/... |
github | gmaze/gmaze_legacy-master | A_compute_potential_density.m | .m | gmaze_legacy-master/matlab/MIT/A_compute_potential_density.m | 4,321 | utf_8 | 090fa41c225cf20e9f319346e8442828 | %
% [ST] = A_compute_potential_density(SNAPSHOT)
%
% For a time snapshot, this program computes the
% 3D potential density from potential temperature and salinity.
% THETA and SALTanom are supposed to be defined on the same
% domain and grid.
% SALTanom is by default a salinity anomaly vs 35.
% If not, (is absolute v... |
github | gmaze/gmaze_legacy-master | B_compute_relative_vorticity.m | .m | gmaze_legacy-master/matlab/MIT/B_compute_relative_vorticity.m | 12,722 | utf_8 | 652104475a986c77fe274efa256c245d | %
% [OMEGA] = B_compute_relative_vorticity(SNAPSHOT)
%
% For a time snapshot, this program computes the
% 3D relative vorticity field from 3D
% horizontal speed fields U,V (x,y,z) as:
% OMEGA = ( -dVdz ; dUdz ; dVdx - dUdy )
% = ( Ox ; Oy ; ZETA )
% 3 outputs files are created.
%
% (U,V) must have s... |
github | gmaze/gmaze_legacy-master | D_compute_potential_vorticity.m | .m | gmaze_legacy-master/matlab/MIT/D_compute_potential_vorticity.m | 4,331 | utf_8 | b213b518eb8297056e63fa2e0fc64301 | %
% [Q] = D_compute_potential_vorticity(SNAPSHOT,[WANTSPLPV])
%
% For a time snapshot, this program multiplies the potential
% vorticity computed with C_COMPUTE_POTENTIAL_VORTICITY by the
% coefficient: -1/RHO
% Optional flag WANTSPLPV is turn to 0 by default. Turn it to 1
% if the PV computed is the simple one (f.dSIG... |
github | gmaze/gmaze_legacy-master | compute_JFzx.m | .m | gmaze_legacy-master/matlab/MIT/compute_JFzx.m | 4,724 | utf_8 | 9031f93ff19f50ba0e4c1c06ef73c400 | %
% [JFzx] = compute_JFzx(SNAPSHOT)
%
% Here we compute the PV flux due to the zonal frictionnal force as
% JFzx = ( TAUx * dSIGMATHETA/dy ) / RHO / EKL
%
% where:
% TAUx is the surface zonal wind-stress (N/m2)
% SIGMATHETA is the potential density (kg/m3)
% RHO is the density (kg/m3)
% EKL is the Ekman layer depth... |
github | gmaze/gmaze_legacy-master | compute_JBz.m | .m | gmaze_legacy-master/matlab/MIT/compute_JBz.m | 3,426 | utf_8 | 3f15ca9e0000e58baf169c9295bda71a | %
% [JBz] = compute_JBz(SNAPSHOT)
%
% Here we compute the PV flux due to diabatic processes as
% JFz = - alpha * f * Qnet / MLD / Cw
% where:
% alpha = 2.5*E-4 1/K is the thermal expansion coefficient
% f = 2*OMEGA*sin(LAT) is the Coriolis parameter
% Qnet is the net surface heat flux (W/m^2), positive downward
% M... |
github | gmaze/gmaze_legacy-master | compute_EKLx.m | .m | gmaze_legacy-master/matlab/MIT/compute_EKLx.m | 3,545 | utf_8 | 8afac5cd178faae3ca29da9a1ffc1d56 | %
% [EKL] = compute_EKLx(SNAPSHOT)
%
% Here we compute the Ekman Layer Depth as:
% EKL = 0.7 sqrt( TAUx/RHO )/f
%
% where:
% TAUx is the amplitude of the zonal surface wind-stress (N/m2)
% RHO is the density of seawater (kg/m3)
% f is the Coriolis parameter (kg/m3)
% EKL is the Ekman layer depth (m)
%
% Files name... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.