Skip to content

Commit

Permalink
rename mir<data|spectrum> to psy<data|>spectrum for compatibility wit…
Browse files Browse the repository at this point in the history
…h MIRtoolbox. more to come!
  • Loading branch information
athabasca committed Mar 31, 2017
1 parent 5b134fa commit 1e8cb52
Show file tree
Hide file tree
Showing 69 changed files with 181 additions and 181 deletions.
10 changes: 5 additions & 5 deletions AudioAnalysers/@MIRPITCH/private/mirinharmonicity.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
% ih = mirinharmonicity(x) estimates the inharmonicity of x, i.e., the
% amount of partials that are not multiples of the fundamental
% frequency.
% x can be either an audio file, a miraudio or a mirspectrum object.
% x can be either an audio file, a miraudio or a psyspectrum object.
% WARNING: This function presupposes that there is only one fundamental
% frequency.
% Optional argument:
Expand Down Expand Up @@ -33,12 +33,12 @@
function [i type] = init(x,option)
if isamir(x,'miraudio')
if option.frame.length.val
s = mirspectrum(x,'Frame',option.frame.length.val,...
s = psyspectrum(x,'Frame',option.frame.length.val,...
option.frame.length.unit,...
option.frame.hop.val,...
option.frame.hop.unit);
else
s = mirspectrum(x);
s = psyspectrum(x);
end
else
s = x;
Expand All @@ -56,7 +56,7 @@
p = option.f0;
end
i = {s,p};
type = {'mirscalar','mirspectrum','mirscalar'};
type = {'mirscalar','psyspectrum','mirscalar'};


function ih = main(x,option,postoption)
Expand Down Expand Up @@ -113,7 +113,7 @@
end
end
ih = mirscalar(s,'Data',v,'Title','Inharmonicity');
if isa(p,'mirdata')
if isa(p,'psydata')
ih = {ih s p};
else
ih = {ih s};
Expand Down
4 changes: 2 additions & 2 deletions AudioAnalysers/@MIRPITCH/private/mirpitch.m
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@
y = mirautocor(orig,'Min',option.mi,'Hz','Max',option.ma,'Hz','Freq');
elseif isamir(orig,'mircepstrum')
y = orig;
elseif isamir(orig,'mirspectrum')
elseif isamir(orig,'psyspectrum')
if not(option.as) && not(option.ce) && not(option.s)
option.ce = 1;
end
Expand Down Expand Up @@ -289,7 +289,7 @@
end
if option.as || option.ce || option.s
x = mirframenow(orig,option);
y = mirspectrum(x);
y = psyspectrum(x);
if option.as
as = mirautocor(y,...
'Min',option.mi,'Hz','Max',option.ma,'Hz');
Expand Down
2 changes: 1 addition & 1 deletion AudioAnalysers/@MIRPITCH/private/mirroughness.m
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
if isamir(x,'miraudio') && not(isframed(x))
x = mirframenow(x,option);
end
x = mirspectrum(x);
x = psyspectrum(x);
if not(haspeaks(x))
x = mirpeaks(x,'Contrast',option.cthr);
end
Expand Down
8 changes: 4 additions & 4 deletions AudioAnalysers/@mirautocor/getMir.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@

switch propName
case 'Coeff'
val = get(mirdata(a),'Data');
val = get(psydata(a),'Data');
case 'Delay'
val = get(mirdata(a),'Pos');
val = get(psydata(a),'Pos');
case 'Lag'
val = get(mirdata(a),'Pos');
val = get(psydata(a),'Pos');
case 'FreqDomain'
val = a.freq;
case 'OfSpectrum'
val = a.ofspectrum;
case 'Window'
val = a.window;
otherwise
val = get(mirdata(a),propName);
val = get(psydata(a),propName);
end
12 changes: 6 additions & 6 deletions AudioAnalysers/@mirautocor/mirautocor.m
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@
a.ofspectrum = [];
a.window = {};
a.normalwindow = [];
a = class(a,'mirautocor', mirdata() );
a = class(a,'mirautocor', psydata() );
a=set(a,'Name','MirToolbox (mirautocor)');
varargout={a};

else
min.key = 'Min';
min.type = 'Integer';
min.unit = {'s','Hz'};
if isamir(orig,'mirspectrum')
if isamir(orig,'psyspectrum')
min.defaultunit = 'Hz';
else
min.defaultunit = 's';
Expand All @@ -88,7 +88,7 @@
max.key = 'Max';
max.type = 'Integer';
max.unit = {'s','Hz'};
if isamir(orig,'mirspectrum')
if isamir(orig,'psyspectrum')
max.defaultunit = 'Hz';
else
max.defaultunit = 's';
Expand Down Expand Up @@ -156,7 +156,7 @@

nw.key = 'NormalWindow';
nw.when = 'Both';
if isamir(orig,'mirspectrum')
if isamir(orig,'psyspectrum')
nw.default = 0;
elseif isamir(orig,'mirenvelope')
nw.default = 'rectangular';
Expand Down Expand Up @@ -229,11 +229,11 @@
a.ofspectrum = 0;
a.window = {};
a.normalwindow = 0;
a = class(a,'mirautocor',mirdata(orig));
a = class(a,'mirautocor',psydata(orig));
a = purgedata(a);
a=set(a,'Name','MirToolbox (mirautocor)'); % Adapted for Psysound3
sig = get(orig,'Data');
if isa(orig,'mirspectrum')
if isa(orig,'psyspectrum')
a = set(a,'Title','Spectrum autocorrelation','OfSpectrum',1,...
'Abs','frequency (Hz)');
pos = get(orig,'Pos');
Expand Down
2 changes: 1 addition & 1 deletion AudioAnalysers/@mirautocor/setMir.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
s = a.ofspectrum;
w = a.window;
nw = a.normalwindow;
d = mirdata(a);
d = psydata(a);
d = set(d,'Title',get(a,'Title'),'Abs',get(a,'Abs'),'Ord',get(a,'Ord'));
while length(propertyArgIn) >= 2,
prop = propertyArgIn{1};
Expand Down
6 changes: 3 additions & 3 deletions AudioAnalysers/@mircepstrum/getMir.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

switch propName
case 'Magnitude'
val = get(mirdata(a),'Data');
val = get(psydata(a),'Data');
case 'Phase'
val = a.phase;
case 'Quefrency'
val = get(mirdata(a),'Pos');
val = get(psydata(a),'Pos');
case 'FreqDomain'
val = a.freq;
otherwise
val = get(mirdata(a),propName);
val = get(psydata(a),propName);
end
10 changes: 5 additions & 5 deletions AudioAnalysers/@mircepstrum/mircepstrum.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
s.phase = [];
s.freq=[];

base=mirdata();
base=psydata();
s=class(s,'mircepstrum',base);
s=set(s,'Name','Mirtoolbox (mircepstrum)');
varargout={s};
Expand All @@ -34,7 +34,7 @@
cl.phase = [];
cl.freq=[];

base=mirdata(orig);
base=psydata(orig);
cl=class(cl,'mircepstrum',base);
cl=set(cl,'Name','Mirtoolbox (mircepstrum)');

Expand Down Expand Up @@ -79,7 +79,7 @@

function [x type] = init(x,option)
if not(isamir(x,'mircepstrum'))
x = mirspectrum(x);
x = psyspectrum(x);
end
type = 'mircepstrum';

Expand All @@ -94,7 +94,7 @@
else
c.freq = 0;
end
c = class(c,'mircepstrum',mirdata(orig));
c = class(c,'mircepstrum',psydata(orig));
c = purgedata(c);
c = set(c,'Title','Cepstrum','Abs','quefrency (s)','Ord','magnitude');
c=set(c,'Name','Mirtoolbox (mircepstrum)'); %For Psysound3
Expand All @@ -121,7 +121,7 @@
c = set(c,'Magnitude',mag,'Phase',pha,'Quefrency',que,'FreqDomain',0);
end
c = modif(c,option);
elseif isa(orig,'mirspectrum')
elseif isa(orig,'psyspectrum')
mag = get(orig,'Magnitude');
pha = get(orig,'Phase');
f = get(orig,'Sampling');
Expand Down
2 changes: 1 addition & 1 deletion AudioAnalysers/@mircepstrum/setMir.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
propertyArgIn = varargin;
p = s.phase;
f = s.freq;
d = mirdata(s);
d = psydata(s);
d = set(d,'Title',get(s,'Title'),'Abs',get(s,'Abs'),'Ord',get(s,'Ord'));
while length(propertyArgIn) >= 2,
prop = propertyArgIn{1};
Expand Down
6 changes: 3 additions & 3 deletions AudioAnalysers/@mirdesign/evaleach.m
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
diffchunks = diff(chunks); % Usual chunk size
d2.postoption = max(diffchunks) - diffchunks(i);
% Reduction of the current chunk size to be taken into
% consideration in mirspectrum, for instance, using
% consideration in psyspectrum, for instance, using
% zeropadding
end
end
Expand Down Expand Up @@ -544,7 +544,7 @@
[ov omatch nmatch] = combinedata(ov,nv,'Time',[],[],@modiftime);
else
[ov omatch nmatch] = combinedata(ov,nv,'Pos',[],[]);
if isa(ov,'mirspectrum')
if isa(ov,'psyspectrum')
[ov omatch nmatch] = combinedata(ov,nv,'Phase',[],[]);
end
end
Expand Down Expand Up @@ -625,7 +625,7 @@
if not(d.ascending)
a.ascending = 0;
end
if isa(a,'mirdata')
if isa(a,'psydata')
% Input already computed
tmpfile = get(a,'TmpFile');
if not(isempty(tmpfile)) && tmpfile.fid > 0
Expand Down
2 changes: 1 addition & 1 deletion AudioAnalysers/@mirdesign/mirdesign.m
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
if iscell(argin)
argin = argin{1};
end
if (strcmp(func2str(orig),'mirspectrum') && d.option.alongbands) ...
if (strcmp(func2str(orig),'psyspectrum') && d.option.alongbands) ...
|| (isfield(specif,'nochunk') && specif.nochunk)
d.frame = [];
if isfield(d.specif,'eachchunk')
Expand Down
2 changes: 1 addition & 1 deletion AudioAnalysers/@mirscalar/getMir.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
case 'Parameter'
val = a.parameter;
otherwise
val = getMir(mirdata(a),propName);
val = getMir(psydata(a),propName);
end

end
2 changes: 1 addition & 1 deletion AudioAnalysers/@mirscalar/mirscalar.m
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
s.parameter = struct;
end

base=mirdata(orig);
base=psydata(orig);
s = class(s,'mirscalar',base);


Expand Down
2 changes: 1 addition & 1 deletion AudioAnalysers/@mirscalar/setMir.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
m = s.mode;
l = s.legend;
p = s.parameter;
d = mirdata(s);
d = psydata(s);
d = setMir(d,'Title',get(s,'Title'),'Abs',get(s,'Abs'),'Ord',get(s,'Ord'));
while length(propertyArgIn) >= 2,
prop = propertyArgIn{1};
Expand Down
2 changes: 1 addition & 1 deletion AudioAnalysers/@mirtemporal/display.m
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ function display(d)
if d.centered
d = set(d,'Title',[get(d,'Title'),' (centered)']);
end
mirdisplay(mirdata(d),inputname(1));
mirdisplay(psydata(d),inputname(1));
2 changes: 1 addition & 1 deletion AudioAnalysers/@mirtemporal/getMir.m
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
case 'NBits'
val = a.nbits;
otherwise
val = get(mirdata(a),propName);
val = get(psydata(a),propName);
end
4 changes: 2 additions & 2 deletions AudioAnalysers/@mirtemporal/mirtemporal.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
if nargin==0


base=mirdata();
base=psydata();
t = class(t,'mirtemporal',base);


else

base=mirdata(orig);
base=psydata(orig);
t = class(t,'mirtemporal',base);

end
Expand Down
2 changes: 1 addition & 1 deletion AudioAnalysers/@mirtemporal/setMir.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
propertyArgIn = varargin;
c = t.centered;
b = t.nbits;
d = mirdata(t);
d = psydata(t);
d = set(d,'Title',get(t,'Title'),'Abs',get(t,'Abs'),'Ord',get(t,'Ord'));
while length(propertyArgIn) >= 2,
prop = propertyArgIn{1};
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
% GET Get properties from the MIRdata object
% and return the value

if strcmp(class(a),'mirdata')
if strcmp(class(a),'psydata')
switch propName
case 'Pos'
val = a.pos;
Expand Down Expand Up @@ -232,10 +232,10 @@

%
% try % ismethod is not going to work in a class hierarchy
% m = ['get', propName]; % put sp meths in mirdata folder?
% m = ['get', propName]; % put sp meths in psydata folder?
% val = eval([m, '(obj)']);
% catch
% error(['Put sp meths in mirdata folder? Analyser: get: ', propName, ' is not a field of the Analyser', ...
% error(['Put sp meths in psydata folder? Analyser: get: ', propName, ' is not a field of the Analyser', ...
% ' class. Could not resolve ', m, ' for class ', class(a)]);
% end
end
Expand All @@ -251,7 +251,7 @@
case 'Parameter'
val = a.parameter;
otherwise
val = get(mirdata(a),propName);
val = get(psydata(a),propName);
end

else
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ function mirdisplay(d,varargin)


% MIRDATA/DISPLAY display of a MIR data
% Section 2 : related to the class mirdata
% Section 2 : related to the class psydata

disp(' ');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
n = get(a,'Name');
t = get(a,'Title');
if not(isa(a,'miraudio'))
if isa(b,'mirdata')
if isa(b,'psydata')
t = [t,' ^ ',get(b,'Title')];
else
t = [t,' ^ ',num2str(b)];
end
end

if isa(b,'mirdata')
if isa(b,'psydata')
e = get(b,'Data');
m = get(b,'Name');
else
Expand Down
Loading

0 comments on commit 1e8cb52

Please sign in to comment.