[8988] in Athena Bugs

home help back first fref pref prev next nref lref last post

vax 7.3P: X (matlab)

daemon@ATHENA.MIT.EDU (-----)
Tue Feb 18 18:20:49 1992

To: bugs@Athena.MIT.EDU
Date: Tue, 18 Feb 92 18:20:30 EST
From: ----- <mojo@Athena.MIT.EDU>

System name:		barker-6-4
Type and version:	VAXSTAR 7.3P
Display type:		SM

What were you trying to do?

	I was using matlab on terminal barker-6-4 when the following things
happened:
1)	First, the middle mouse key stopped working (for copying text to
the matlab command line).  It later came back, sporadically.
2)	A little later, matlab stopped graphing some of the plots I sent to
it.

	Here's a complete list of the matlab session, in case that's useful
(unlikely!):


>> clear tvres
>> clear tvir
>> load tvres
>> y1 = tvres(impulse,b1,1);
>> y2 = tvres(impulse,b1,2);
>> plot(t,y1,t,y2)
>> h1 = tvir(b1,1);
>> h2 = tvir(b1,2);
>> h4 = tvir(b2,1);
>> h5 = tvir(b2,2);
>> plot(t,y1,t,h1)
>> y1(1)

ans =

    0.0061

>> h1(1)

ans =

     0

>> y2(1)

ans =

    0.0061

>> clear tvres
>> y1 = tvres(impulse,b1,1);
>> y2 = tvres(impulse,b1,2);
>> plot(t,y1,t,h1)
>> plot(t,y2,t,h2)
>> y5 = tvres(impulse,b2,2);
>> y4 = tvres(impulse,b2,1);
>> plot(t,y4,t,h4)
>> plot(t,y5,t,h5)
>> clear tvres
>> clear tvir
	**** middle mouse button stopped working here ****
>>  y1 = tvres(impulse,b1,1);
>>  y2 = tvres(impulse,b1,2);
>>  y5 = tvres(impulse,b2,2);
>>  y4 = tvres(impulse,b2,1);
>>  h1 = tvir(b1,1);
>>  h2 = tvir(b1,2);
>>  h4 = tvir(b1,4);
>>  h5 = tvir(b1,5);
>> plot(t,y1,t,h1)
>> plot(t,y2,t,h2)
	**** plot command stopped working here ****
>> plot(t,y4,t,h4)
>> plot(t,y4,t,h4)
>> plot(t,y5,t,h5)
>> plot(t,y5,t,h5)
>> plot(t,y4,t,h4)


	Using these function files:

function y = tvres(x, b, circ)
%	y = tvres(x, b, circ)
%	filter X using a time-varying resonator with poles defined in
%	B, using Fujisaki & Azami circuit number CIRC, at fs = 10KHz.

sigma = 0.05;
r = exp(-sigma);

a1 = 2 * r .* cos(b .* 2 * pi/10000);
n1 = r * sin(b * 2 * pi / 10000);
n0 = 0;
N = (1 - a1 + r^2) ./ (n0 + n1);
% N = (1 - a1 + r^2);

if circ == 1
	x = N .* x;
end
if circ == 3
	x = sqrt(N) .* x;
end

y(1) = n0*x(1);
y(2) = n0*x(2) + n1(2)*x(1) + a1(2)*y(1);

for i = 3:length(b)
	y(i) = n0*x(i) + n1(i)*x(i-1) + a1(i)*y(i-1) - r^2 * y(i-2);
	if	circ == 4
		y(i) = y(i) * exp(-2 * pi * (b(i)-b(i-1)) / 100000000);
	end
end

if circ == 2
	y = N .* y;
end
if circ == 4
	y = N .* y;
end
if circ == 3
	y = sqrt(N) .* y;
end




function y = tvir(b, circ)
%	y = tvir(b, circ)
%	Fake the impulse response of the time-varying resonators in
%	Fujisaki & Azami.

sigma = 0.05;
r = exp(-sigma);

a1 = 2 * r .* cos(b .* 2 * pi/10000);
n1 = r * sin(b * 2 * pi/10000);
n0 = 0;
N = (1 - a1 + r^2) ./ (n0 + n1);
% N = (1 - a1 + r^2);
Ntild = [N(1),N(1:(length(N)-1))];

bnt = zeros(b);
rnt = ones(b);
for i = 2:length(b)
	bnt(i) = bnt(i-1) + 2 * pi .* b(i) ./ 10000;
	rnt(i) = r * rnt(i-1);
end

if circ == 1
	y = Ntild .* rnt .* sin(bnt);
end
if circ == 2
	y = N .* rnt .* sin(bnt);
end
if circ == 3
	y = sqrt(N .* Ntild) .* rnt .* sin(bnt);
end


home help back first fref pref prev next nref lref last post