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
cs1471/Modelling-master
icwtband2.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/directfit_tutorial/strflab/preprocessing/wavelet/icwtband2.m
4,543
utf_8
839221419d4955e146d2b49f809f7b9c
function [cm,V] = icwtband2(ym,S,level,orientation,real_or_cplx); % 2-D Dual-tree Complex Wavelet Transform: % Function to determine where to insert a modified subimage ym in C % and to convert from complex to real format if ym is complex. % It is necessary to use 'C(V) = cm;' to then do the insertion. % (For la...
github
cs1471/Modelling-master
cwtband6.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/directfit_tutorial/strflab/preprocessing/wavelet/cwtband6.m
2,631
utf_8
607c99791f8114c2bd3b60f70f7a2248
function Z = cwtband6(C,S,level) % 2-D Dual-tree Complex Wavelet Transform: % Function to retrieve the set of 6 complex bandpass subimages % at level from the 2-D DT CWT vector C. % % output = cwtband6(C,S,level) % % C -> The column vector containing the Subbands % S -> The "Bookkeeping" matrix % ...
github
cs1471/Modelling-master
cwtband2.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/directfit_tutorial/strflab/preprocessing/wavelet/kbcode/cwtband2.m
4,589
utf_8
327a4f44ce0ca7a9231e4a1fc4e761f0
function Z = cwtband2(C,S,level,orientation,real_or_cplx) % 2-D Dual-tree Complex Wavelet Transform: % Function to retrieve the subimage required from the 2-D DT CWT vector C. % % output = cwtband2(C,S,level,orientation,real_or_cplx) % % C -> The column vector containing the Subbands % S -> The "Bookk...
github
cs1471/Modelling-master
icwtband6.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/directfit_tutorial/strflab/preprocessing/wavelet/kbcode/icwtband6.m
2,871
utf_8
afe7d5b2e1c1041fc00289e23d399c9e
function [cm,V] = icwtband6(ym,S,level); % 2-D Dual-tree Complex Wavelet Transform: % Function to determine where to insert a modified set of 6 subimages ym % into C and to convert from complex to real format. % It is necessary to use 'C(V) = cm;' to then do the insertion. % (For large arrays C, this is much mo...
github
cs1471/Modelling-master
icwtband2.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/directfit_tutorial/strflab/preprocessing/wavelet/kbcode/icwtband2.m
4,543
utf_8
839221419d4955e146d2b49f809f7b9c
function [cm,V] = icwtband2(ym,S,level,orientation,real_or_cplx); % 2-D Dual-tree Complex Wavelet Transform: % Function to determine where to insert a modified subimage ym in C % and to convert from complex to real format if ym is complex. % It is necessary to use 'C(V) = cm;' to then do the insertion. % (For la...
github
cs1471/Modelling-master
cwtband6.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/directfit_tutorial/strflab/preprocessing/wavelet/kbcode/cwtband6.m
2,631
utf_8
607c99791f8114c2bd3b60f70f7a2248
function Z = cwtband6(C,S,level) % 2-D Dual-tree Complex Wavelet Transform: % Function to retrieve the set of 6 complex bandpass subimages % at level from the 2-D DT CWT vector C. % % output = cwtband6(C,S,level) % % C -> The column vector containing the Subbands % S -> The "Bookkeeping" matrix % ...
github
cs1471/Modelling-master
wfb2rec.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/directfit_tutorial/strflab/preprocessing/contourlet/wfb2rec.m
1,419
utf_8
a8eb98892d022925b472758e34d4640d
function x = wfb2rec(x_LL, x_LH, x_HL, x_HH, h, g) % WFB2REC 2-D Wavelet Filter Bank Decomposition % % x = wfb2rec(x_LL, x_LH, x_HL, x_HH, h, g) % % Input: % x_LL, x_LH, x_HL, x_HH: Four 2-D wavelet subbands % h, g: lowpass analysis and synthesis wavelet filters % % Output: % x: reconst...
github
cs1471/Modelling-master
wfb2dec.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/directfit_tutorial/strflab/preprocessing/contourlet/wfb2dec.m
1,359
utf_8
cf0a7abcc9abae631039550460b07a48
function [x_LL, x_LH, x_HL, x_HH] = wfb2dec(x, h, g) % WFB2DEC 2-D Wavelet Filter Bank Decomposition % % y = wfb2dec(x, h, g) % % Input: % x: input image % h, g: lowpass analysis and synthesis wavelet filters % % Output: % x_LL, x_LH, x_HL, x_HH: Four 2-D wavelet subbands % Make sure...
github
cs1471/Modelling-master
extend2.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/directfit_tutorial/strflab/preprocessing/contourlet/extend2.m
1,861
utf_8
40bc6d67909280efd214bb2536a4a46f
function y = extend2(x, ru, rd, cl, cr, extmod) % EXTEND2 2D extension % % y = extend2(x, ru, rd, cl, cr, extmod) % % Input: % x: input image % ru, rd: amount of extension, up and down, for rows % cl, cr: amount of extension, left and rigth, for column % extmod: extension mode. The valid modes are: % 'per...
github
cs1471/Modelling-master
trnEN.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/directfit_tutorial/strflab/layer_3optim/trnEN.m
6,291
utf_8
fec66d3cc7aaed9fe281af346773c0b4
function beta = larsen(X, y, options) % LARSEN The LARSEN algorithm for elastic net regression. % BETA = LARSEN(X, Y) performs elastic net regression on the variables % in X to approximate the response Y. Variables X are assumed to be % normalized (zero mean, unit length), the response Y is assumed to be...
github
cs1471/Modelling-master
trnDirectFit.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/directfit_tutorial/strflab/layer_3optim/trnDirectFit.m
9,092
utf_8
71f4e915420f97acebbe8d67db9f486c
%% Direct Fit training routine % % Input: % modelParams: % % datIdx: % % options: % .sparsenesses: a vector of sparseness values to test against % .tolerances: a vector of tolerance values to use % .separable: 0=space-time separable, 1=non-separable (defaults to 1) % ...
github
cs1471/Modelling-master
trnGradDescLineSearch.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/directfit_tutorial/strflab/layer_3optim/trnGradDescLineSearch.m
13,829
utf_8
378fe173f3d849598537191c42bccc0c
function [strf,options]=trnGradDescAdaptive(strf,datIdx,options,varargin) %function [strf,options]=trnGradDescAdaptive(strf,datIdx,options,varargin) % % Gradient descent / coordinate descent optimization of STRF. % % INPUT: % [strf] = model structure obtained via upper level *Init functions % ...
github
cs1471/Modelling-master
get_function_dir.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/directfit_tutorial/strflab/auxFunc/get_function_dir.m
210
utf_8
3997eff604223e9deb52d1baa2b379b2
%% Gets the directory in which a function resides function dname = get_function_dir(funcName) dname = ''; fpath = which(funcName); if ~isempty(fpath) dname = fileparts(fpath); end
github
cs1471/Modelling-master
cv.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/directfit_tutorial/strflab/auxFunc/cv.m
160
utf_8
5f66257a915476d907f128db55f0655b
%column vector function b = cv(a) b = a; sz = size(a); isvect = (sz(1) == 1) || (sz(2) == 1); if (isvect) if (sz(2) == 1) b = a'; end end
github
cs1471/Modelling-master
rv.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/directfit_tutorial/strflab/auxFunc/rv.m
156
utf_8
2f21009ec2efedb59c7ef77232cb7673
%row vector function b = rv(a) b = a; sz = size(a); isvect = (sz(1) == 1) || (sz(2) == 1); if (isvect) if (sz(1) == 1) b = a'; end end
github
cs1471/Modelling-master
get_filenames.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/directfit_tutorial/strflab/auxFunc/get_filenames.m
1,015
utf_8
9c16cf99e5ff7c2dc8fc73810b5df29b
%% Get a list of filenames in a directory that match a given regular expression % % Input: % datadir: directory that contains data files % regex: regular expression to match against file names % preprendDataDir: whether to prepend datadir to file names in output % % Output: % filenames: a ce...
github
cs1471/Modelling-master
conv_strf.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/directfit_tutorial/strflab/auxFunc/conv_strf.m
907
utf_8
79ced193fba953e5498341eb6384dcb1
%% Convolve a stimulus with a STRF % % Input: % allstim: % % delays: % % strf: % % groupIndex: % % Output: % % modelResponse: % % function modelResponse = conv_strf(allstim, delays, strf, groupIndex) nDatasets = length(unique(groupIndex)); timeLen = size(allstim, 1); a = z...
github
cs1471/Modelling-master
getSubMatrix.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/directfit_tutorial/strflab/auxFunc/getSubMatrix.m
2,494
utf_8
087245d938e0c04c28716f81e1b5a9cb
function [A, idxr, idxc] = getSubMatrix(hsize, locality, sdimension); %function A = getSubMatrix(hsize, sdimension) % % A function to extract the relevant parts of a covariance matrix % % INPUT: % [hsize] = vector of sizes for each dimension of the stimulus % [locality] = determines how far away to consider pixe...
github
cs1471/Modelling-master
sr2df.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/directfit_tutorial/strflab/auxFunc/direct_fit/sr2df.m
1,451
utf_8
2438793dd336e70acbcaae97b4b3d94d
%% Convert stim/response data structure (from preprocess.sound.m) to the DS %% structure that direct_fit uses % % Input: % srData: a stim/response data structure produced by % preprocess_sound.m % % outputPath: an arbitrary directory where intermediate files are % written, used to load sti...
github
cs1471/Modelling-master
sr2df.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/directfit_tutorial/direct_fit/sr2df.m
1,451
utf_8
2438793dd336e70acbcaae97b4b3d94d
%% Convert stim/response data structure (from preprocess.sound.m) to the DS %% structure that direct_fit uses % % Input: % srData: a stim/response data structure produced by % preprocess_sound.m % % outputPath: an arbitrary directory where intermediate files are % written, used to load sti...
github
cs1471/Modelling-master
compute_coherence_mean.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/directfit_tutorial/validation/compute_coherence_mean.m
3,951
utf_8
795c723ea465e5a65ea164505bdd11d7
%% Compute the jacknifed multi-tapered coherence and normal mutual information %% between a model response and mean PSTH. From: %% %% Anne Hsu et al 2004 Network: Comput. Neural Syst. 15 91-109 % % Input: % modelResponse: time series model response % % psth: time series actual PSTH, should be same length...
github
cs1471/Modelling-master
get_filenames.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/directfit_tutorial/validation/get_filenames.m
1,074
utf_8
3bde12774fc1a51842eb451203f5189c
%% Get a list of filenames in a directory that match a given regular expression % % Input: % datadir: directory that contains data files % regex: regular expression to match against file names % preprendDataDir: whether to prepend datadir to file names in output % % Output: % filenames: a ce...
github
cs1471/Modelling-master
compute_coherence_bound.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/directfit_tutorial/validation/compute_coherence_bound.m
1,431
utf_8
e9aaad8d12284c82b20a5163f980517c
%% compute the expected coherence of a single spike train and estimated PSTH function cStruct = compute_coherence_bound(psthHalf1, psthHalf2, numSpikeTrials, sampleRate, freqCutoff, windowSize) %% compute coherence between two halves of PSTH cMeanHalves = compute_coherence_mean(psthHalf1, psthHalf2, sampleRate...
github
cs1471/Modelling-master
find_datasets.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/directfit_tutorial/validation/find_datasets.m
2,235
utf_8
f3dba9d78c1295c89731e32d6a35c672
function datasets = find_datasets(rootdir, stimDir, expr) if nargin < 3 expr = []; end %conspecific: zfsongs, conspecific datasets = {}; dcnt = 1; fnames = dir(rootdir); for k = 1:length(fnames) if ~strcmp('.', fnames(k).name) && ~strcmp('..', fnames(k).name) ...
github
cs1471/Modelling-master
poisson_gen_spikes.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/cross-coherence/poisson_gen_spikes.m
1,299
utf_8
c394c2afda9b8256ad44a3f71a544f54
function spiketimes = poisson_gen_spikes(psth, meanfr, numTrials) % Generates an array of spike arrival times at a mean firing rate given by % meanfr and a time varying rate given by psth in ms. % Written by Alex Huth 11/12/2009 % modified by Mike Schachter %generates spike times in units of seconds inbinwidth = 1; %...
github
cs1471/Modelling-master
preprocess_sound.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/strflab_graddesc/preprocessing/preprocess_sound.m
6,341
utf_8
ad622ee869178fab285bb02775b7c227
%% Preprocess .wav files and spike times into time-frequency representations and PSTHs % % Input: % rawStimFiles: a cell array of .wav file names % % rawRespFiles: a cell array of spike-time file names. Each file % contains a space-separated list of file times, one line for each % trial. ...
github
cs1471/Modelling-master
split_psth.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/strflab_graddesc/preprocessing/split_psth.m
1,098
utf_8
ced7f94ed52f33644b35bbb26e10afbc
%% Takes a cell array of spike time vectors (one cell for each trial), and % converts it to a PSTH. It also splits the trials in half, and creates a % PSTH for each half. % stimLengthMs: The length of the stimlulus in milliseconds % % Returns a struct psthdata, where: % psthdata.psth: PSTH from all trials % ...
github
cs1471/Modelling-master
rv.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/strflab_graddesc/preprocessing/rv.m
156
utf_8
2f21009ec2efedb59c7ef77232cb7673
%row vector function b = rv(a) b = a; sz = size(a); isvect = (sz(1) == 1) || (sz(2) == 1); if (isvect) if (sz(1) == 1) b = a'; end end
github
cs1471/Modelling-master
timefreq.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/strflab_graddesc/preprocessing/timefreq.m
4,328
utf_8
9082007afd83813b174a853cc71a5abe
%% General purpose time-frequency representation function % % Input: % wavFileName: path to .wav file % % typeName: 'ft' for short-time fourier transforms % 'wavelet' for wavelet transforms % 'lyons' for lyons-model % % params: depends on typeName, default values used...
github
cs1471/Modelling-master
make_tfrep.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/strflab_graddesc/preprocessing/make_tfrep.m
1,774
utf_8
a44e2f132640a5c289cdf4d5cc2af4a8
%% Create a time-frequency representation structure % Input: % typeName: 'ft', 'wavelet', 'lyons' % % params: parameters to assign tfrep (optional, if not given then % default values will be specified for type) % % Output: % tfrep: the time-frequency structure, for use with display_tfrep...
github
cs1471/Modelling-master
check_fields.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/strflab_graddesc/preprocessing/check_fields.m
1,505
utf_8
dbd1d425a24ecc49caa9c2b6760b3ea6
%% Checks a structure to make sure it contains the proper fields % % Input: % % structInstance: a structure to check % % requiredFields: a cell array of field names to verify % % messageTemplate: a string error message with a %s to specify param % name % % defaultValues: a cell ar...
github
cs1471/Modelling-master
getSmoothnessPrior.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/strflab_graddesc/strflab/preprocessing/getSmoothnessPrior.m
2,580
utf_8
45a2210c36f4f8eda447c5dc67c87fe2
function A = getSmoothnessPrior(hsize, sdimension); %function A = getSmoothnessPrior(hsize, sdimension) % % A function to make a smoothnessprior matrix for N-D matrix of size: hsize % The matrix can be either 1D ~ 3D or 4D % % INPUT: % [hsize] = vector of sizes for each dimension of matrix % [sdimension] = determi...
github
cs1471/Modelling-master
preprocWavelets_2007-07-25.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/strflab_graddesc/strflab/preprocessing/preprocWavelets_2007-07-25.m
11,761
utf_8
1f1e200b20a024b7214830ecfd01b681
function [PS, params] = preprocWavelets(S, params); % function [PS, params] = preprocWavelets(S, params); % % A script for preprocessing of stimuli using a Gabor wavelet bais set % % PARAMS = preprocWavelets; % returns the default set of parameters. % % [PS, PARAMS] = preprocWavelets(S, PARAMS) % returns prepro...
github
cs1471/Modelling-master
ndimages.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/strflab_graddesc/strflab/preprocessing/ndimages.m
4,733
utf_8
fa310b35265e783c1b2df62977387af2
function out = ndimages(im, Params) %function out = ndimages(im, Params) % % Allows for the display of n-dimensional (up to 6-d) images by tiling % along higher dimensions % % INPUT: % [im] = a matrix to be displayed (up to 6 dimensions) % [Params] = structure that contains parameters % .clim = The minimum a...
github
cs1471/Modelling-master
preprocWavelets3d.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/strflab_graddesc/strflab/preprocessing/preprocWavelets3d.m
13,460
utf_8
aa654f7554386e10e8bd5589b475f585
function [stim, params] = preprocWavelets3d(rawStim, params); % function [stim, params] = preprocWavelets(rawStim, params); % % A script for preprocessing of stimuli using a Gabor wavelet bais set % % INPUT: % [rawStim] = A X-by-Y-by-T matrix containing stimuli (movie) % [params] = structure that c...
github
cs1471/Modelling-master
preprocSpectraVis.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/strflab_graddesc/strflab/preprocessing/preprocSpectraVis.m
715
utf_8
2d681ef925efced874883daa70a5be13
function preprocSpectraVis(net); %function preprocSpectraVis(net); % % A visualizer of glm net preprocessed by preprocSpectra % % INPUT: % [net] = strf structure to be visualized % params = net.params; fsize = params.fSize; w = net.w1; delays = net.delays; k = reshape(w, [fsize length(delays)]); maxk = max(abs(k(:...
github
cs1471/Modelling-master
fdct_wrapping_dispcoef.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/strflab_graddesc/strflab/preprocessing/curvelet/fdct_wrapping_dispcoef.m
1,993
utf_8
e67846c8e34ac43ee9cc8b47a70a7976
function img = fdct_wrapping_dispcoef(C) % fdct_wrapping_dispcoef - returns an image containing all the curvelet coefficients % % Inputs % C Curvelet coefficients % % Outputs % img Image containing all the curvelet coefficients. The coefficents are rescaled so that % the largest c...
github
cs1471/Modelling-master
icwtband.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/strflab_graddesc/strflab/preprocessing/wavelet/icwtband.m
3,340
utf_8
f16dde8670ec29d13224d272f1c1c525
function [cm,V] = icwtband(ym,L,level,passband,real_or_cplx); % Function to determine where to insert a modified subband ym in C % and to convert from complex to real format if ym is complex. % It is necessary to use 'C(V) = cm;' to then do the insertion. % (For large arrays C, this is much more efficient than co...
github
cs1471/Modelling-master
icdwt2.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/strflab_graddesc/strflab/preprocessing/wavelet/icdwt2.m
969
utf_8
e66b61d78f490f361d00b82a5fc3ddfc
% icdwt2.m % % Wrapper function for NGK's 2D dual-tree complex wavelet code % Inverse 2D transform (synthesis) % The wavelet set (near_sym_a, qshift_a) is hardwired in right now. % Usage : x = icdwt2(w1, w2, L) % % Written by : Justin Romberg % Created : 1/30/2001 function x = icdwt2(w1, w2, L) N = size(w...
github
cs1471/Modelling-master
cwtband2.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/strflab_graddesc/strflab/preprocessing/wavelet/cwtband2.m
4,589
utf_8
327a4f44ce0ca7a9231e4a1fc4e761f0
function Z = cwtband2(C,S,level,orientation,real_or_cplx) % 2-D Dual-tree Complex Wavelet Transform: % Function to retrieve the subimage required from the 2-D DT CWT vector C. % % output = cwtband2(C,S,level,orientation,real_or_cplx) % % C -> The column vector containing the Subbands % S -> The "Bookk...
github
cs1471/Modelling-master
cdwt2.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/strflab_graddesc/strflab/preprocessing/wavelet/cdwt2.m
1,503
utf_8
bdf964b0a98da471e135259b23c41d1c
% cdwt2.m % % Wrapper function for NGK's 2D dual-tree complex wavelet code % Forward 2D transform (analysis) % The wavelet set (near_sym_a, qshift_a) is hardwired in right now. % Usage : [w1, w2] = cdwt2(x, L) % w1 - subbands with directions % ----------------- % | | | % | X |...
github
cs1471/Modelling-master
icwtband6.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/strflab_graddesc/strflab/preprocessing/wavelet/icwtband6.m
2,871
utf_8
afe7d5b2e1c1041fc00289e23d399c9e
function [cm,V] = icwtband6(ym,S,level); % 2-D Dual-tree Complex Wavelet Transform: % Function to determine where to insert a modified set of 6 subimages ym % into C and to convert from complex to real format. % It is necessary to use 'C(V) = cm;' to then do the insertion. % (For large arrays C, this is much mo...
github
cs1471/Modelling-master
cdwt.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/strflab_graddesc/strflab/preprocessing/wavelet/cdwt.m
743
utf_8
09074428fddca9c42995a2dfa15938a4
% cdwt.m % % Wrapper function for NGK's 1D dual-tree complex wavelet code. % The wavelet set (near_sym_a, qshift_a) is hardwired in right now. % Usage : w = cdwt(x, L) % % Written by : Justin Romberg % Created : 12/5/2000 function w = cdwt(x, L) % make x a column vector rw = 0; if (size(x,1) == 1) x =...
github
cs1471/Modelling-master
icdwt.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/strflab_graddesc/strflab/preprocessing/wavelet/icdwt.m
711
utf_8
dee542ce3519fb5296ec228cb2d062a0
% icdwt.m % % Wrapper function for NGK's 1D dual-tree complex wavelet code. % The wavelet set (near_sym_a, qshift_a) is hardwired. % Usage : x = icdwt(w, L) % % Written by : Justin Romberg % Created : 12/5/2000 function x = icdwt(w, L) rw = 0; if (size(w,1) == 1) rw = 1; w = w.'; end Lx = log2(l...
github
cs1471/Modelling-master
icwtband2.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/strflab_graddesc/strflab/preprocessing/wavelet/icwtband2.m
4,543
utf_8
839221419d4955e146d2b49f809f7b9c
function [cm,V] = icwtband2(ym,S,level,orientation,real_or_cplx); % 2-D Dual-tree Complex Wavelet Transform: % Function to determine where to insert a modified subimage ym in C % and to convert from complex to real format if ym is complex. % It is necessary to use 'C(V) = cm;' to then do the insertion. % (For la...
github
cs1471/Modelling-master
cwtband6.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/strflab_graddesc/strflab/preprocessing/wavelet/cwtband6.m
2,631
utf_8
607c99791f8114c2bd3b60f70f7a2248
function Z = cwtband6(C,S,level) % 2-D Dual-tree Complex Wavelet Transform: % Function to retrieve the set of 6 complex bandpass subimages % at level from the 2-D DT CWT vector C. % % output = cwtband6(C,S,level) % % C -> The column vector containing the Subbands % S -> The "Bookkeeping" matrix % ...
github
cs1471/Modelling-master
cwtband2.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/strflab_graddesc/strflab/preprocessing/wavelet/kbcode/cwtband2.m
4,589
utf_8
327a4f44ce0ca7a9231e4a1fc4e761f0
function Z = cwtband2(C,S,level,orientation,real_or_cplx) % 2-D Dual-tree Complex Wavelet Transform: % Function to retrieve the subimage required from the 2-D DT CWT vector C. % % output = cwtband2(C,S,level,orientation,real_or_cplx) % % C -> The column vector containing the Subbands % S -> The "Bookk...
github
cs1471/Modelling-master
icwtband6.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/strflab_graddesc/strflab/preprocessing/wavelet/kbcode/icwtband6.m
2,871
utf_8
afe7d5b2e1c1041fc00289e23d399c9e
function [cm,V] = icwtband6(ym,S,level); % 2-D Dual-tree Complex Wavelet Transform: % Function to determine where to insert a modified set of 6 subimages ym % into C and to convert from complex to real format. % It is necessary to use 'C(V) = cm;' to then do the insertion. % (For large arrays C, this is much mo...
github
cs1471/Modelling-master
icwtband2.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/strflab_graddesc/strflab/preprocessing/wavelet/kbcode/icwtband2.m
4,543
utf_8
839221419d4955e146d2b49f809f7b9c
function [cm,V] = icwtband2(ym,S,level,orientation,real_or_cplx); % 2-D Dual-tree Complex Wavelet Transform: % Function to determine where to insert a modified subimage ym in C % and to convert from complex to real format if ym is complex. % It is necessary to use 'C(V) = cm;' to then do the insertion. % (For la...
github
cs1471/Modelling-master
cwtband6.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/strflab_graddesc/strflab/preprocessing/wavelet/kbcode/cwtband6.m
2,631
utf_8
607c99791f8114c2bd3b60f70f7a2248
function Z = cwtband6(C,S,level) % 2-D Dual-tree Complex Wavelet Transform: % Function to retrieve the set of 6 complex bandpass subimages % at level from the 2-D DT CWT vector C. % % output = cwtband6(C,S,level) % % C -> The column vector containing the Subbands % S -> The "Bookkeeping" matrix % ...
github
cs1471/Modelling-master
wfb2rec.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/strflab_graddesc/strflab/preprocessing/contourlet/wfb2rec.m
1,419
utf_8
a8eb98892d022925b472758e34d4640d
function x = wfb2rec(x_LL, x_LH, x_HL, x_HH, h, g) % WFB2REC 2-D Wavelet Filter Bank Decomposition % % x = wfb2rec(x_LL, x_LH, x_HL, x_HH, h, g) % % Input: % x_LL, x_LH, x_HL, x_HH: Four 2-D wavelet subbands % h, g: lowpass analysis and synthesis wavelet filters % % Output: % x: reconst...
github
cs1471/Modelling-master
wfb2dec.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/strflab_graddesc/strflab/preprocessing/contourlet/wfb2dec.m
1,359
utf_8
cf0a7abcc9abae631039550460b07a48
function [x_LL, x_LH, x_HL, x_HH] = wfb2dec(x, h, g) % WFB2DEC 2-D Wavelet Filter Bank Decomposition % % y = wfb2dec(x, h, g) % % Input: % x: input image % h, g: lowpass analysis and synthesis wavelet filters % % Output: % x_LL, x_LH, x_HL, x_HH: Four 2-D wavelet subbands % Make sure...
github
cs1471/Modelling-master
extend2.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/strflab_graddesc/strflab/preprocessing/contourlet/extend2.m
1,861
utf_8
40bc6d67909280efd214bb2536a4a46f
function y = extend2(x, ru, rd, cl, cr, extmod) % EXTEND2 2D extension % % y = extend2(x, ru, rd, cl, cr, extmod) % % Input: % x: input image % ru, rd: amount of extension, up and down, for rows % cl, cr: amount of extension, left and rigth, for column % extmod: extension mode. The valid modes are: % 'per...
github
cs1471/Modelling-master
trnEN.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/strflab_graddesc/strflab/layer_3optim/trnEN.m
6,291
utf_8
fec66d3cc7aaed9fe281af346773c0b4
function beta = larsen(X, y, options) % LARSEN The LARSEN algorithm for elastic net regression. % BETA = LARSEN(X, Y) performs elastic net regression on the variables % in X to approximate the response Y. Variables X are assumed to be % normalized (zero mean, unit length), the response Y is assumed to be...
github
cs1471/Modelling-master
trnDirectFit.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/strflab_graddesc/strflab/layer_3optim/trnDirectFit.m
9,092
utf_8
71f4e915420f97acebbe8d67db9f486c
%% Direct Fit training routine % % Input: % modelParams: % % datIdx: % % options: % .sparsenesses: a vector of sparseness values to test against % .tolerances: a vector of tolerance values to use % .separable: 0=space-time separable, 1=non-separable (defaults to 1) % ...
github
cs1471/Modelling-master
trnGradDescLineSearch.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/strflab_graddesc/strflab/layer_3optim/trnGradDescLineSearch.m
13,829
utf_8
378fe173f3d849598537191c42bccc0c
function [strf,options]=trnGradDescAdaptive(strf,datIdx,options,varargin) %function [strf,options]=trnGradDescAdaptive(strf,datIdx,options,varargin) % % Gradient descent / coordinate descent optimization of STRF. % % INPUT: % [strf] = model structure obtained via upper level *Init functions % ...
github
cs1471/Modelling-master
get_function_dir.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/strflab_graddesc/strflab/auxFunc/get_function_dir.m
210
utf_8
3997eff604223e9deb52d1baa2b379b2
%% Gets the directory in which a function resides function dname = get_function_dir(funcName) dname = ''; fpath = which(funcName); if ~isempty(fpath) dname = fileparts(fpath); end
github
cs1471/Modelling-master
cv.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/strflab_graddesc/strflab/auxFunc/cv.m
160
utf_8
5f66257a915476d907f128db55f0655b
%column vector function b = cv(a) b = a; sz = size(a); isvect = (sz(1) == 1) || (sz(2) == 1); if (isvect) if (sz(2) == 1) b = a'; end end
github
cs1471/Modelling-master
rv.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/strflab_graddesc/strflab/auxFunc/rv.m
156
utf_8
2f21009ec2efedb59c7ef77232cb7673
%row vector function b = rv(a) b = a; sz = size(a); isvect = (sz(1) == 1) || (sz(2) == 1); if (isvect) if (sz(1) == 1) b = a'; end end
github
cs1471/Modelling-master
get_filenames.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/strflab_graddesc/strflab/auxFunc/get_filenames.m
1,015
utf_8
9c16cf99e5ff7c2dc8fc73810b5df29b
%% Get a list of filenames in a directory that match a given regular expression % % Input: % datadir: directory that contains data files % regex: regular expression to match against file names % preprendDataDir: whether to prepend datadir to file names in output % % Output: % filenames: a ce...
github
cs1471/Modelling-master
conv_strf.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/strflab_graddesc/strflab/auxFunc/conv_strf.m
907
utf_8
79ced193fba953e5498341eb6384dcb1
%% Convolve a stimulus with a STRF % % Input: % allstim: % % delays: % % strf: % % groupIndex: % % Output: % % modelResponse: % % function modelResponse = conv_strf(allstim, delays, strf, groupIndex) nDatasets = length(unique(groupIndex)); timeLen = size(allstim, 1); a = z...
github
cs1471/Modelling-master
getSubMatrix.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/strflab_graddesc/strflab/auxFunc/getSubMatrix.m
2,494
utf_8
087245d938e0c04c28716f81e1b5a9cb
function [A, idxr, idxc] = getSubMatrix(hsize, locality, sdimension); %function A = getSubMatrix(hsize, sdimension) % % A function to extract the relevant parts of a covariance matrix % % INPUT: % [hsize] = vector of sizes for each dimension of the stimulus % [locality] = determines how far away to consider pixe...
github
cs1471/Modelling-master
sr2df.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/strflab_graddesc/strflab/auxFunc/direct_fit/sr2df.m
1,451
utf_8
2438793dd336e70acbcaae97b4b3d94d
%% Convert stim/response data structure (from preprocess.sound.m) to the DS %% structure that direct_fit uses % % Input: % srData: a stim/response data structure produced by % preprocess_sound.m % % outputPath: an arbitrary directory where intermediate files are % written, used to load sti...
github
cs1471/Modelling-master
compute_coherence_mean.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/strflab_graddesc/validation/compute_coherence_mean.m
3,951
utf_8
795c723ea465e5a65ea164505bdd11d7
%% Compute the jacknifed multi-tapered coherence and normal mutual information %% between a model response and mean PSTH. From: %% %% Anne Hsu et al 2004 Network: Comput. Neural Syst. 15 91-109 % % Input: % modelResponse: time series model response % % psth: time series actual PSTH, should be same length...
github
cs1471/Modelling-master
get_filenames.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/strflab_graddesc/validation/get_filenames.m
1,074
utf_8
3bde12774fc1a51842eb451203f5189c
%% Get a list of filenames in a directory that match a given regular expression % % Input: % datadir: directory that contains data files % regex: regular expression to match against file names % preprendDataDir: whether to prepend datadir to file names in output % % Output: % filenames: a ce...
github
cs1471/Modelling-master
compute_coherence_bound.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/strflab_graddesc/validation/compute_coherence_bound.m
1,431
utf_8
e9aaad8d12284c82b20a5163f980517c
%% compute the expected coherence of a single spike train and estimated PSTH function cStruct = compute_coherence_bound(psthHalf1, psthHalf2, numSpikeTrials, sampleRate, freqCutoff, windowSize) %% compute coherence between two halves of PSTH cMeanHalves = compute_coherence_mean(psthHalf1, psthHalf2, sampleRate...
github
cs1471/Modelling-master
find_datasets.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/strflab_graddesc/validation/find_datasets.m
2,235
utf_8
f3dba9d78c1295c89731e32d6a35c672
function datasets = find_datasets(rootdir, stimDir, expr) if nargin < 3 expr = []; end %conspecific: zfsongs, conspecific datasets = {}; dcnt = 1; fnames = dir(rootdir); for k = 1:length(fnames) if ~strcmp('.', fnames(k).name) && ~strcmp('..', fnames(k).name) ...
github
cs1471/Modelling-master
preprocess_sound.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/coherence_tutorial/preprocessing/preprocess_sound.m
6,342
utf_8
e91d29d5b29f792a623454d0d567b9fe
%% Preprocess .wav files and spike times into time-frequency representations and PSTHs % % Input: % rawStimFiles: a cell array of .wav file names % % rawRespFiles: a cell array of spike-time file names. Each file % contains a space-separated list of file times, one line for each % trial. ...
github
cs1471/Modelling-master
rv.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/coherence_tutorial/preprocessing/rv.m
156
utf_8
2f21009ec2efedb59c7ef77232cb7673
%row vector function b = rv(a) b = a; sz = size(a); isvect = (sz(1) == 1) || (sz(2) == 1); if (isvect) if (sz(1) == 1) b = a'; end end
github
cs1471/Modelling-master
timefreq.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/coherence_tutorial/preprocessing/timefreq.m
4,328
utf_8
9082007afd83813b174a853cc71a5abe
%% General purpose time-frequency representation function % % Input: % wavFileName: path to .wav file % % typeName: 'ft' for short-time fourier transforms % 'wavelet' for wavelet transforms % 'lyons' for lyons-model % % params: depends on typeName, default values used...
github
cs1471/Modelling-master
make_tfrep.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/coherence_tutorial/preprocessing/make_tfrep.m
1,774
utf_8
a44e2f132640a5c289cdf4d5cc2af4a8
%% Create a time-frequency representation structure % Input: % typeName: 'ft', 'wavelet', 'lyons' % % params: parameters to assign tfrep (optional, if not given then % default values will be specified for type) % % Output: % tfrep: the time-frequency structure, for use with display_tfrep...
github
cs1471/Modelling-master
check_fields.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/coherence_tutorial/preprocessing/check_fields.m
1,505
utf_8
dbd1d425a24ecc49caa9c2b6760b3ea6
%% Checks a structure to make sure it contains the proper fields % % Input: % % structInstance: a structure to check % % requiredFields: a cell array of field names to verify % % messageTemplate: a string error message with a %s to specify param % name % % defaultValues: a cell ar...
github
cs1471/Modelling-master
compute_coherence_mean.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/coherence_tutorial/validation/compute_coherence_mean.m
3,951
utf_8
795c723ea465e5a65ea164505bdd11d7
%% Compute the jacknifed multi-tapered coherence and normal mutual information %% between a model response and mean PSTH. From: %% %% Anne Hsu et al 2004 Network: Comput. Neural Syst. 15 91-109 % % Input: % modelResponse: time series model response % % psth: time series actual PSTH, should be same length...
github
cs1471/Modelling-master
get_filenames.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/coherence_tutorial/validation/get_filenames.m
1,074
utf_8
3bde12774fc1a51842eb451203f5189c
%% Get a list of filenames in a directory that match a given regular expression % % Input: % datadir: directory that contains data files % regex: regular expression to match against file names % preprendDataDir: whether to prepend datadir to file names in output % % Output: % filenames: a ce...
github
cs1471/Modelling-master
compute_coherence_bound.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/coherence_tutorial/validation/compute_coherence_bound.m
1,431
utf_8
e9aaad8d12284c82b20a5163f980517c
%% compute the expected coherence of a single spike train and estimated PSTH function cStruct = compute_coherence_bound(psthHalf1, psthHalf2, numSpikeTrials, sampleRate, freqCutoff, windowSize) %% compute coherence between two halves of PSTH cMeanHalves = compute_coherence_mean(psthHalf1, psthHalf2, sampleRate...
github
cs1471/Modelling-master
find_datasets.m
.m
Modelling-master/month_Frederic_Theunissen/CodingPractice/coherence_tutorial/validation/find_datasets.m
2,235
utf_8
f3dba9d78c1295c89731e32d6a35c672
function datasets = find_datasets(rootdir, stimDir, expr) if nargin < 3 expr = []; end %conspecific: zfsongs, conspecific datasets = {}; dcnt = 1; fnames = dir(rootdir); for k = 1:length(fnames) if ~strcmp('.', fnames(k).name) && ~strcmp('..', fnames(k).name) ...
github
cs1471/Modelling-master
estimate.m
.m
Modelling-master/month_OdeliaSchwartz/codingPractice/BerkeleyCourse2016/imageica/code/estimate.m
9,216
utf_8
4c1f3e22c37f089f81eb7eb952f821f4
function estimate( whiteningMatrix, dewhiteningMatrix, fname, p ) % estimate - algorithms for topographic, subspace, and standard ICA % % SYNTAX: % estimate( whiteningMatrix, dewhiteningMatrix, fname, dims ); % % NOTE: X passed as global! % % X preprocessed (whitened) sample vectors in columns % whiten...
github
cs1471/Modelling-master
estimateModif.m
.m
Modelling-master/month_OdeliaSchwartz/codingPractice/BerkeleyCourse2016/imageica/code/estimateModif.m
9,320
utf_8
68690a2792bcf343c2c9a6a7fd7449b5
function estimateModif( whiteningMatrix, dewhiteningMatrix, fname, p, numIters) % estimate - algorithms for topographic, subspace, and standard ICA % % SYNTAX: % estimate( whiteningMatrix, dewhiteningMatrix, fname, dims ); % % NOTE: X passed as global! % % X preprocessed (whitened) sample vectors in co...
github
cs1471/Modelling-master
gaussEstim.m
.m
Modelling-master/month_OdeliaSchwartz/codingPractice/BerkeleyCourse2016/LabExtraFiles/gaussEstim.m
429
utf_8
fb08549dfb064b58948074d17c0ca2a7
function theres = gaussEstim(l, lself, n, a); % function theres = gaussEstim(l, lself, n, a); % estimate Gaussian component of the GSM % a Rayleigh parameter % n number of filters % lself is filter response; l is gain pool response thefac = (1./(a.*lself.^2).^.25) .* (l.^2./lself.^2).^.25; thefac=1./thefac; the...
github
cs1471/Modelling-master
ica4.m
.m
Modelling-master/month_OdeliaSchwartz/codingPractice/BerkeleyCourse2016/LabExtraFiles/ica4.m
902
utf_8
5e8e0fe321e0c752c01d0359b7228d22
% [NEWSIG, MAT, EVALS] = ica4(SIG) % % If SIG is a matrix of col vector signals, NEWSIG are the signals % separated out into independent components through Cardoso's Fourth % Order Blind Identification (FOBI) algorithm. % MAT gives the transformation matrix: % PSIG = MAT * SIG % % EVALS gives the eigenvalues of ...
github
cs1471/Modelling-master
mypca.m
.m
Modelling-master/month_OdeliaSchwartz/codingPractice/BerkeleyCourse2016/LabExtraFiles/mypca.m
1,168
utf_8
02d5cd1f9b764aee66a519632e59cef3
% [NEWSIG, EVECS, EVALS, MAT] = pca(SIG,WHITEN) % % If SIG is a matrix whose columns are sample vectors drawn from a % probability density, NEWSIG is matrix whose columns have been % projected onto the principal components of the data. If % WHITEN is non-zero (default), the values will be scaled to unit % variance ...
github
cs1471/Modelling-master
sortedEig.m
.m
Modelling-master/month_OdeliaSchwartz/codingPractice/BerkeleyCourse2016/LabExtraFiles/sortedEig.m
362
utf_8
6c209c32b6332a5d3acbbfa0c4c65947
% [E, D] = sortedEig(X) % % Calls matlab's "eig" function for computing % eigenvalues/eigenvectors, but re-orders the solution to run from % largest eigenvalue to smallest. % Eero Simoncelli, 11/97. function [E, D] = sortedEig(X) [Eo, Do] = eig(X); Do = diag(Do); [junk,Ind] = sort(Do); D = diag(Do(Ind(size(Ind,1):...
github
cs1471/Modelling-master
innerProd.m
.m
Modelling-master/month_OdeliaSchwartz/codingPractice/BerkeleyCourse2016/LabExtraFiles/innerProd.m
405
utf_8
e323c3c423813239c338506b982ca8a2
% RES = innerProd(MTX) % % Compute (MTX' * MTX) efficiently (i.e., without copying the matrix) function res = innerProd(mtx) %% NOTE: THIS CODE SHOULD NOT BE USED! (MEX FILE IS CALLED INSTEAD) %fprintf(1,'WARNING: You should compile the MEX version of "innerProd.c",\n found in the MEX subdirectory of matlabP...
github
cs1471/Modelling-master
mybowtie.m
.m
Modelling-master/month_OdeliaSchwartz/codingPractice/BerkeleyCourse2016/LabExtraFiles/mybowtie.m
277
utf_8
6c9176393601db72a32855ed7fde668e
% function bowtie(n1, n2) % Plot a bowtie conditional dependency between n1 and n2 function bowtie(n1, n2) binsz=51; [H,Y,X] = jhisto(n1, n2, binsz); colmax = max(1,max(H)); H = H ./ (ones(size(H,1),1)*colmax); imagesc(X,Y,H); axis('xy'); axis('square'); colormap('gray');
github
cs1471/Modelling-master
jhisto.m
.m
Modelling-master/month_OdeliaSchwartz/codingPractice/BerkeleyCourse2016/LabExtraFiles/jhisto.m
1,393
utf_8
16dc756c1a6b85fb196dff1cb6821628
% [N, Y, X] = JHISTO(YIMAGE, XIMAGE, NBINS_OR_BINSIZE, BIN_CENTER) % % Compute joint histogram of Yimage and Ximage. % % NBINS_OR_BINSIZE (optional, default = 101) specifies either % the number of histogram bins, or the negative of the binsize. % It can be a [Y,X] 2-vector or it can be a scalar. % % BIN_CENTER (optiona...
github
cs1471/Modelling-master
histoMatchMod.m
.m
Modelling-master/month_OdeliaSchwartz/codingPractice/BerkeleyCourse2016/LabExtraFiles/histoMatchMod.m
977
utf_8
c5fbabf600ece1dab7487bbfc0b5a861
% RES = histoMatch(MTX, N, X) % % Modify elements of MTX so that normalized histogram matches that % specified by vectors X and N, where N contains the histogram counts % and X the histogram bin positions (see histo). % Eero Simoncelli, 7/96. % OS 2003 Change to 0 if nan in interpolation function res = histoMatch(mtx...
github
cs1471/Modelling-master
sp3Filters.m
.m
Modelling-master/month_OdeliaSchwartz/codingPractice/BerkeleyCourse2016/matlabPyrTools/sp3Filters.m
17,188
utf_8
a3514d77e5a92b96d96197ebad343395
% Steerable pyramid filters. Transform described in: % % @INPROCEEDINGS{Simoncelli95b, % TITLE = "The Steerable Pyramid: A Flexible Architecture for % Multi-Scale Derivative Computation", % AUTHOR = "E P Simoncelli and W T Freeman", % BOOKTITLE = "Second Int'l Conf on Image Processing", % ADDRESS = "Washington, DC"...
github
cs1471/Modelling-master
buildWpyr.m
.m
Modelling-master/month_OdeliaSchwartz/codingPractice/BerkeleyCourse2016/matlabPyrTools/buildWpyr.m
2,644
utf_8
e741b2037d9a1358d4de94580ebcc4bf
% [PYR, INDICES] = buildWpyr(IM, HEIGHT, FILT, EDGES) % % Construct a separable orthonormal QMF/wavelet pyramid on matrix (or vector) IM. % % HEIGHT (optional) specifies the number of pyramid levels to build. Default % is maxPyrHt(IM,FILT). You can also specify 'auto' to use this value. % % FILT (optional) can be a st...
github
cs1471/Modelling-master
reconLpyr.m
.m
Modelling-master/month_OdeliaSchwartz/codingPractice/BerkeleyCourse2016/matlabPyrTools/reconLpyr.m
2,049
utf_8
657b8012a1ed06b6573496855309b2ae
% RES = reconLpyr(PYR, INDICES, LEVS, FILT2, EDGES) % % Reconstruct image from Laplacian pyramid, as created by buildLpyr. % % PYR is a vector containing the N pyramid subbands, ordered from fine % to coarse. INDICES is an Nx2 matrix containing the sizes of % each subband. This is compatible with the MatLab Wavelet t...
github
cs1471/Modelling-master
mkDisc.m
.m
Modelling-master/month_OdeliaSchwartz/codingPractice/BerkeleyCourse2016/matlabPyrTools/mkDisc.m
1,428
utf_8
c6acae0ac1aa738b7ef094eb2ac60f52
% IM = mkDisc(SIZE, RADIUS, ORIGIN, TWIDTH, VALS) % % Make a "disk" image. SIZE specifies the matrix size, as for % zeros(). RADIUS (default = min(size)/4) specifies the radius of % the disk. ORIGIN (default = (size+1)/2) specifies the % location of the disk center. TWIDTH (in pixels, default = 2) % specifies th...
github
cs1471/Modelling-master
spyrHigh.m
.m
Modelling-master/month_OdeliaSchwartz/codingPractice/BerkeleyCourse2016/matlabPyrTools/spyrHigh.m
189
utf_8
3132a747e0c7bf1879bb32e4d5fda257
% RES = spyrHigh(PYR, INDICES) % % Access the highpass residual band from a steerable pyramid. % Eero Simoncelli, 6/96. function res = spyrHigh(pyr,pind) res = pyrBand(pyr, pind, 1);
github
cs1471/Modelling-master
mkImpulse.m
.m
Modelling-master/month_OdeliaSchwartz/codingPractice/BerkeleyCourse2016/matlabPyrTools/mkImpulse.m
529
utf_8
cf6f3809cb123791501bb0e92845a0c6
% IM = mkImpulse(SIZE, ORIGIN, AMPLITUDE) % % Compute a matrix of dimension SIZE (a [Y X] 2-vector, or a scalar) % containing a single non-zero entry, at position ORIGIN (defaults to % ceil(size/2)), of value AMPLITUDE (defaults to 1). % Eero Simoncelli, 6/96. function [res] = mkImpulse(sz, origin, amplitude) sz = s...
github
cs1471/Modelling-master
rconv2.m
.m
Modelling-master/month_OdeliaSchwartz/codingPractice/BerkeleyCourse2016/matlabPyrTools/rconv2.m
1,435
utf_8
da3a54d6c7b1ac17c78eab0a4a7648d9
% RES = RCONV2(MTX1, MTX2, CTR) % % Convolution of two matrices, with boundaries handled via reflection % about the edge pixels. Result will be of size of LARGER matrix. % % The origin of the smaller matrix is assumed to be its center. % For even dimensions, the origin is determined by the CTR (optional) % argument:...
github
cs1471/Modelling-master
mkR.m
.m
Modelling-master/month_OdeliaSchwartz/codingPractice/BerkeleyCourse2016/matlabPyrTools/mkR.m
775
utf_8
504bc90f67c72730edc4a9d86630bdf2
% IM = mkR(SIZE, EXPT, ORIGIN) % % Compute a matrix of dimension SIZE (a [Y X] 2-vector, or a scalar) % containing samples of a radial ramp function, raised to power EXPT % (default = 1), with given ORIGIN (default = (size+1)/2, [1 1] = % upper left). All but the first argument are optional. % Eero Simoncelli, 6/96....
github
cs1471/Modelling-master
blur.m
.m
Modelling-master/month_OdeliaSchwartz/codingPractice/BerkeleyCourse2016/matlabPyrTools/blur.m
1,731
utf_8
a2dc57fdfe85f98549b2f7ddf721c298
% RES = blur(IM, LEVELS, FILT) % % Blur an image, by filtering and downsampling LEVELS times % (default=1), followed by upsampling and filtering LEVELS times. The % blurring is done with filter kernel specified by FILT (default = % 'binom5'), which can be a string (to be passed to namedFilter), a % vector (applied sep...
github
cs1471/Modelling-master
pyrBand.m
.m
Modelling-master/month_OdeliaSchwartz/codingPractice/BerkeleyCourse2016/matlabPyrTools/pyrBand.m
395
utf_8
39c1e3772426a1362119d302d9767a24
% RES = pyrBand(PYR, INDICES, BAND_NUM) % % Access a subband from a pyramid (gaussian, laplacian, QMF/wavelet, % or steerable). Subbands are numbered consecutively, from finest % (highest spatial frequency) to coarsest (lowest spatial frequency). % Eero Simoncelli, 6/96. function res = pyrBand(pyr, pind, band) re...
github
cs1471/Modelling-master
kurt2.m
.m
Modelling-master/month_OdeliaSchwartz/codingPractice/BerkeleyCourse2016/matlabPyrTools/kurt2.m
551
utf_8
cd20c1a5155cba8de454011552ec4f2a
% K = KURT2(MTX,MEAN,VAR) % % Sample kurtosis (fourth moment divided by squared variance) % of a matrix. Kurtosis of a Gaussian distribution is 3. % MEAN (optional) and VAR (optional) make the computation faster. % Eero Simoncelli, 6/96. function res = kurt2(mtx, mn, v) if (exist('mn') ~= 1) mn = mean(mean(mtx)...
github
cs1471/Modelling-master
buildSpyr.m
.m
Modelling-master/month_OdeliaSchwartz/codingPractice/BerkeleyCourse2016/matlabPyrTools/buildSpyr.m
2,064
utf_8
b0caf60e63a52aa734956dd74ea39f95
% [PYR, INDICES, STEERMTX, HARMONICS] = buildSpyr(IM, HEIGHT, FILTFILE, EDGES) % % Construct a steerable pyramid on matrix IM. Convolutions are % done with spatial filters. % % HEIGHT (optional) specifies the number of pyramid levels to build. Default % is maxPyrHt(size(IM),size(FILT)). % You can also specify 'auto' ...
github
cs1471/Modelling-master
setPyrBand.m
.m
Modelling-master/month_OdeliaSchwartz/codingPractice/BerkeleyCourse2016/matlabPyrTools/setPyrBand.m
1,049
utf_8
76554eb735e969097a4723a508facd37
% NEWPYR = setPyrBand(PYR, INDICES, NEWBAND, BAND_NUM) % % Insert an image (BAND) into a pyramid (gaussian, laplacian, QMF/wavelet, % or steerable). Subbands are numbered consecutively, from finest % (highest spatial frequency) to coarsest (lowest spatial frequency). % Eero Simoncelli, 1/03. function pyr = setPyrB...
github
cs1471/Modelling-master
var2.m
.m
Modelling-master/month_OdeliaSchwartz/codingPractice/BerkeleyCourse2016/matlabPyrTools/var2.m
390
utf_8
de26727e055081aa670024c273f0e885
% V = VAR2(MTX,MEAN) % % Sample variance of a matrix. % Passing MEAN (optional) makes the calculation faster. function res = var2(mtx, mn) if (exist('mn') ~= 1) mn = mean2(mtx); end if (isreal(mtx)) res = sum(sum(abs(mtx-mn).^2)) / max((prod(size(mtx)) - 1),1); else res = sum(sum(real(mtx-mn).^2)) + i*sum(su...