[B1,A1] = cheby2(2,40,0.1);
scaleb1 = round(B1.*256)
scaleb1 = scaleb1./256;
scalea1 = round(A1.*256)
scalea1 = scalea1./256;

[B2,A2] = cheby2(1,20,[0.1 0.2]);
scaleb2 = round(B2.*256)
scaleb2 = scaleb2./256;
scalea2 = round(A2.*256)
scalea2 = scalea2./256;

[B3,A3] = cheby2(1,20,[0.2 0.3]);
scaleb3 = round(B3.*256)
scaleb3 = scaleb3./256;
scalea3 = round(A3.*256)
scalea3 = scalea3./256;

[B4,A4] = cheby2(1,20,[0.3 0.4]);
scaleb4 = round(B4.*256)
scaleb4 = scaleb4./256;
scalea4 = round(A4.*256)
scalea4 = scalea4./256;

[B5,A5] = cheby2(1,20,[0.4 0.5]);
scaleb5 = round(B5.*256)
scaleb5 = scaleb5./256;
scalea5 = round(A5.*256)
scalea5 = scalea5./256;

[B6,A6] = cheby2(1,20,[0.6 0.7]);
scaleb6 = round(B1.*256)
scaleb6 = scaleb6./256;
scalea6 = round(A6.*256)
scalea6 = scalea6./256;

[B7,A7] = cheby2(1,20,[0.7 0.8]);
scaleb7 = round(B7.*256)
scaleb7 = scaleb7./256;
scalea7 = round(A7.*256)
scalea7 = scalea7./256;

[B8,A8] = cheby2(1,20,[0.8 0.9]);
scaleb8 = round(B8.*256)
scaleb8 = scaleb8./256;
scalea8 = round(A8.*256)
scalea8 = scalea8./256;

[B9,A9] = cheby2(1,20,[0.5 0.6]);
scaleb9 = round(B9.*256)
scaleb9 = scaleb9./256;
scalea9 = round(A9.*256)
scalea9 = scalea9./256;

[B10,A10] = cheby2(2,40,0.9,'high');
scaleb10 = round(B10.*256)
scaleb10 = scaleb10./256;
scalea10 = round(A10.*256)
scalea10 = scalea10./256;


% [sos1,g1] = tf2sos(B1,A1,'up','inf');
% scaleco1 = round(sos1.*256);
% scaleco1 = scaleco1./256;
% scaleg1 = round(g1*256);
% scaleg1 = scaleg1/256;
% [B11,A11] = sos2tf(scaleco1,scaleg1);
% 
% [B2,A2] = cheby2(1,20,[0.1 0.2])
% [sos2,g2] = tf2sos(B2,A2,'up','inf');
% scaleco2 = round(sos2.*256);
% scaleco2 = scaleco2./256;
% scaleg2 = round(g2*256);
% scaleg2 = scaleg2/256;
% [B22,A22] = sos2tf(scaleco2,scaleg2);
% 
% [B3,A3] = cheby2(1,40,[0.2 0.3])
% [sos3,g3] = tf2sos(B3,A3,'up','inf');
% scaleco3 = round(sos3.*256)
% scaleco3 = scaleco3./256;
% scaleg3 = round(g3*256)
% scaleg3 = scaleg3/256;
% [B33,A33] = sos2tf(scaleco3,scaleg3);
% % 
% [B4,A4] = cheby2(1,40,[0.3 0.4])
% [sos4,g4] = tf2sos(B4,A4,'up','inf');
% scaleco4 = round(sos4.*256);
% scaleco4 = scaleco4./256;
% scaleg4 = round(g4*256)
% scaleg4 = scaleg4/256;
% [B44,A44] = sos2tf(scaleco4,scaleg4);
% 
% [B5,A5] = cheby2(1,40,[0.4 0.5])
% [sos5,g5] = tf2sos(B5,A5,'up','inf');
% scaleco5 = round(sos5.*256)
% scaleco5 = scaleco5./256;
% scaleg5 = round(g5*256)
% scaleg5 = scaleg5/256;
% [B55,A55] = sos2tf(scaleco5,scaleg5);
% 
% [B6,A6] = cheby2(1,40,[0.5 0.6])
% [sos6,g6] = tf2sos(B6,A6,'up','inf');
% scaleco6 = round(sos6.*256)
% scaleco6 = scaleco6./256;
% scaleg6 = round(g6*256);
% scaleg6 = scaleg6/256;
% [B66,A66] = sos2tf(scaleco6,scaleg6);
% 
% [B7,A7] = cheby2(1,40,[0.6 0.7])
% [sos7,g7] = tf2sos(B7,A7,'up','inf');
% scaleco7 = round(sos7.*256)
% scaleco7 = scaleco7./256;
% scaleg7 = round(g7*256)
% scaleg7 = scaleg7/256;
% [B77,A77] = sos2tf(scaleco7,scaleg7);
% 
% [B8,A8] = cheby2(1,40,[0.7 0.8])
% [sos8,g8] = tf2sos(B8,A8,'up','inf');
% scaleco8 = round(sos8.*256)
% scaleco8 = scaleco8./256;
% scaleg8 = round(g8*256);
% scaleg8 = scaleg8/256;
% [B88,A88] = sos2tf(scaleco8,scaleg8);
% 
% [B9,A9] = cheby2(1,40,[0.8 0.9])
% [sos9,g9] = tf2sos(B9,A9,'up','inf');
% scaleco9 = round(sos9.*256)
% scaleco9 = scaleco9./256;
% scaleg9 = round(g9*256);
% scaleg9 = scaleg9/256;
% [B99,A99] = sos2tf(scaleco9,scaleg9);
% 
% [B10,A10] = cheby2(4,40,0.9,'high')
% [sos10,g10] = tf2sos(B10,A10,'up','inf');
% scaleco10 = round(sos10.*256);
% scaleco10 = scaleco10./256;
% scaleg10 = round(g10*256);
% scaleg10 = scaleg10/256;
% [B100,A100] = sos2tf(scaleco10,scaleg10);

% close all
% figure(1)
% freqz(B2,A2);
% hold on
% freqz(B21,A21);
% %  
