clc
clear all
close all
fs=8000;
S=200;
r1=105.35;
r2=106.66;
R1=111.11;
R2=112.5;
R3=112.5;
g1=118.51;
g2=120;
G1=125;
G2=126.26;
G3=126.26;
M1=133.33;
M2=135;
m1=140.62;
m2=142.38;
P=150;
d1=158.02;
d2=160;
D1=166.66;
D2=168.75;
D3=168.75;
n1=177.77;
n2=180;
N1=187.50;
N2=189.84;
N3=189.84;
t=0:1/fs:0.5;
A=10;
x_S=A*sin(2*pi*S*t);
x_r1=A*sin(2*pi*r1*t);
x_r2=A*sin(2*pi*r2*t);
x_R1=A*sin(2*pi*R1*t);
x_R2=A*sin(2*pi*R2*t);
x_R3=A*sin(2*pi*R3*t);
x_g1=A*sin(2*pi*g1*t);
x_g2=A*sin(2*pi*g2*t);
x_G1=A*sin(2*pi*G1*t);
x_G2=A*sin(2*pi*G2*t);
x_G3=A*sin(2*pi*G3*t);
x_M1=A*sin(2*pi*M1*t);
x_M2=A*sin(2*pi*M2*t);
x_m1=A*sin(2*pi*m1*t);
x_m2=A*sin(2*pi*m2*t);
x_P=A*sin(2*pi*P*t);
x_D1=A*sin(2*pi*D1*t);
x_D2=A*sin(2*pi*D2*t);
x_D3=A*sin(2*pi*D3*t);
x_d1=A*sin(2*pi*d1*t);
x_d2=A*sin(2*pi*d2*t);
x_n1=A*sin(2*pi*n1*t);
x_n2=A*sin(2*pi*n2*t);
x_N1=A*sin(2*pi*N1*t);
x_N2=A*sin(2*pi*N2*t);
x_N3=A*sin(2*pi*N3*t);
% Hasyam (Happy)
Janaranjini=[x_S x_R2 x_G3 x_M1 x_P x_D2 x_N3 x_S x_S x_S x_D2 x_P x_M1 x_R2 x_S x_S];
Bilahari=[x_S x_R2 x_G3 x_P x_D2 x_S x_S x_S x_N3 x_D2 x_P x_M1 x_G3 x_R2 x_S x_S];
Mohanam=[x_S x_R2 x_G3 x_P x_D2 x_S x_S x_S x_D2 x_P x_G3 x_R2 x_S x_S];
Amrithavarshini=[x_S x_G3 x_M2 x_P x_N3 x_S x_S x_S x_N3 x_P x_M2 x_G3 x_S x_S];
Hamsanadam=[x_S x_R2 x_M2 x_P x_D3 x_N3 x_S x_S x_S x_N3 x_D3 x_P x_M2 x_R2 x_S x_S];
dr=10;
subplot(5,7,1)
DATA1=downsample(Janaranjini,dr);
spec1=abs(specgram(DATA1));
image(spec1)
title('Janaranjini')
set(gca,'YTick',0:40:120)
% set(gca,'XTickLabel',time(1:40:end))
subplot(5,7,8)
DATA2=downsample(Bilahari,dr);
spec2=abs(specgram(DATA2));
image(spec2)
title('Bilahari')
set(gca,'YTick',0:40:120)
subplot(5,7,15)
DATA3=downsample(Mohanam,dr);
spec3=abs(specgram(DATA3));
image(spec3)
title('Mohanam')
set(gca,'YTick',0:40:120)
subplot(5,7,22)
DATA4=downsample(Amrithavarshini,dr);
spec4=abs(specgram(DATA4));
image(spec4)
title('Amrithavarshini')
set(gca,'YTick',0:40:120)
subplot(5,7,29)
DATA5=downsample(Hamsanadam,dr);
spec5=abs(specgram(DATA5));
image(spec5)
title('Hamsanadam')
set(gca,'YTick',0:40:120)

% Karunam (Pleading)
Kharaharapriya=[x_S x_R2 x_G2 x_M1 x_P x_D2 x_N2 x_S x_S x_S x_N2 x_D2 x_P x_M1 x_G2 x_R2 x_S x_S];
Shanmugapriya=[x_S x_R2 x_G2 x_M2 x_P x_D1 x_N2 x_S x_S x_S x_N2 x_D1 x_M2 x_G2 x_R2 x_S x_S];
Gowri_manohari=[x_S x_R2 x_G2 x_M1 x_P x_D2 x_N3 x_S x_S x_S x_N3 x_D2 x_P x_M1 x_G2 x_R2 x_S x_S];
Keeravani=[x_S x_R2 x_G2 x_M1 x_P x_D1 x_N3 x_S x_S x_S x_N3 x_D1 x_P x_M1 x_G2 x_R2 x_S x_S];
Hemavathi=[x_S x_R2 x_G2 x_M2 x_P x_D2 x_N2 x_S x_S x_S x_N2 x_D2 x_P x_M2 x_G2 x_R2 x_S x_S];

subplot(5,7,2)
DATA6=downsample(Kharaharapriya,dr);
spec6=abs(specgram(DATA6));
image(spec6)
title('Kharaharapriya')
set(gca,'YTick',0:40:120)
subplot(5,7,9)
DATA7=downsample(Shanmugapriya,dr);
spec7=abs(specgram(DATA7));
image(spec7)
title('Shanmugapriya')
set(gca,'YTick',0:40:120)
subplot(5,7,16)
DATA8=downsample(Gowri_manohari,dr);
spec8=abs(specgram(DATA8));
image(spec8)
title('Gowri Manohari')
set(gca,'YTick',0:40:120)
subplot(5,7,23)
DATA9=downsample(Keeravani,dr);
spec9=abs(specgram(DATA9));
image(spec9)
title('Keeravani')
set(gca,'YTick',0:40:120)
subplot(5,7,30)
DATA10=downsample(Hemavathi,dr);
spec10=abs(specgram(DATA10));
image(spec10)
title('Hemavathi')
set(gca,'YTick',0:40:120)

% Shantham (soothing)
Devagandhari=[x_S x_R2 x_M1 x_P x_D2 x_S x_S x_S x_N3 x_D2 x_P x_M1 x_G3 x_R2 x_S x_S];
Kedaragowla=[x_S x_R2 x_M1 x_P x_N2 x_S x_S x_S x_N2 x_D2 x_P x_M1 x_G3 x_R2 x_S x_S];
Neelambari=[x_S x_R2 x_G3 x_M1 x_P x_D2 x_P x_N3 x_S x_S x_S x_N3 x_P x_M1 x_G3 x_R2 x_G3 x_S x_S];
Kurinji=[x_S x_N3 x_S x_R2 x_G3 x_M1 x_P x_D2 x_S x_D2 x_P x_M1 x_G3 x_R2 x_S x_N3 x_S x_S];
Chenchurutti=[x_D2 x_S x_R2 x_G3 x_M1 x_P x_D2 x_N2 x_S x_N2 x_D2 x_P x_M1 x_G3 x_R2 x_S x_N2 x_D2 x_P x_D2 x_S x_S];

subplot(5,7,3)
DATA11=downsample(Devagandhari,dr);
spec11=abs(specgram(DATA11));
image(spec11)
title('Devagandhari')
set(gca,'YTick',0:40:120)
subplot(5,7,10)
DATA12=downsample(Kedaragowla,dr);
spec12=abs(specgram(DATA12));
image(spec12)
title('Kedaragowla')
set(gca,'YTick',0:40:120)
subplot(5,7,17)
DATA13=downsample(Neelambari,dr);
spec13=abs(specgram(DATA13));
image(spec13)
title('Neelambari')
set(gca,'YTick',0:40:120)
subplot(5,7,24)
DATA14=downsample(Kurinji,dr);
spec14=abs(specgram(DATA14));
image(spec14)
title('Kurinji')
set(gca,'YTick',0:40:120)
subplot(5,7,31)
DATA15=downsample(Chenchurutti,dr);
spec15=abs(specgram(DATA15));
image(spec15)
title('Chenchurutti')
set(gca,'YTick',0:40:120)

% Shringaram (Romantic)
Sahana=[x_S x_R2 x_G3 x_M1 x_P x_M1 x_D2 x_N2 x_S x_S x_S x_N2 x_S x_D2 x_N2 x_D2 x_P x_M1 x_G3 x_M1 x_R2 x_G3 x_R2 x_S x_S];
Maand=[x_S x_G3 x_M1 x_P x_D2 x_S x_S x_S x_N3 x_D2 x_P x_M1 x_G3 x_R2 x_S x_S];
Kedaram=[x_S x_M1 x_G3 x_M1 x_P x_N3 x_S x_S x_S x_N3 x_P x_M1 x_G3 x_R2 x_S x_S];
Surutti=[x_S x_R2 x_M1 x_P x_N2 x_S x_S x_S x_N2 x_D2 x_P x_M1 x_G3 x_P x_M1 x_R2 x_S x_S];

subplot(5,7,4)
DATA16=downsample(Sahana,dr);
spec16=abs(specgram(DATA16));
image(spec16)
title('Sahana')
set(gca,'YTick',0:40:120)
subplot(5,7,11)
DATA17=downsample(Maand,dr);
spec17=abs(specgram(DATA17));
image(spec17)
title('Maand')
set(gca,'YTick',0:40:120)
subplot(5,7,18)
DATA18=downsample(Kedaram,dr);
spec18=abs(specgram(DATA18));
image(spec18)
title('Kedaram')
set(gca,'YTick',0:40:120)
subplot(5,7,25)
DATA19=downsample(Surutti,dr);
spec19=abs(specgram(DATA19));
image(spec19)
title('Surutti')
set(gca,'YTick',0:40:120)

% Gambheeram (Strength or Energy)
Atana=[x_S x_R2 x_M1 x_P x_N3 x_S x_S x_S x_N3 x_D2 x_P x_M1 x_P x_G3 x_R2 x_S x_S];
Vasantha=[x_S x_R2 x_G2 x_M1 x_D2 x_N3 x_S x_S x_S x_N3 x_D2 x_M1 x_G2 x_R2 x_S x_S];
Gambheera_Nattai=[x_S x_G3 x_M1 x_P x_N3 x_S x_S x_S x_N3 x_P x_M1 x_G3 x_S x_S];
Durbar=[x_S x_R2 x_M1 x_P x_D2 x_N2 x_S x_S x_R2 x_S x_N2 x_S x_D2 x_P x_M1 x_R2 x_G2 x_G2 x_R2 x_S x_S];

subplot(5,7,5)
DATA20=downsample(Atana,dr);
spec20=abs(specgram(DATA20));
image(spec20)
title('Atana')
set(gca,'YTick',0:40:120)
subplot(5,7,12)
DATA21=downsample(Vasantha,dr);
spec21=abs(specgram(DATA21));
image(spec21)
title('Vasantha')
set(gca,'YTick',0:40:120)
subplot(5,7,19)
DATA22=downsample(Gambheera_Nattai,dr);
spec22=abs(specgram(DATA22));
image(spec22)
title('Gambheera Nattai')
set(gca,'YTick',0:40:120)
subplot(5,7,26)
DATA23=downsample(Durbar,dr);
spec23=abs(specgram(DATA23));
image(spec23)
title('Durbar')
set(gca,'YTick',0:40:120)

% Roudram (Anger)
Revathi=[x_S x_R1 x_M1 x_P x_N2 x_S x_S x_S x_N2 x_P x_M1 x_R1 x_S x_S];
Ranjani=[x_S x_R2 x_G2 x_M2 x_D2 x_S x_S x_S x_N3 x_D2 x_M2 x_G2 x_S x_R2 x_G2 x_S x_S];
Varali=[x_S x_G1 x_R1 x_G1 x_M2 x_P x_D1 x_N3 x_S x_S x_S x_N3 x_D1 x_P x_M2 x_G1 x_R1 x_S x_S];
Gowlipanthu=[x_S x_R1 x_M1 x_P x_N3 x_S x_S x_S x_N3 x_D1 x_P x_M1 x_D1 x_M1 x_G3 x_R1 x_S x_S];

subplot(5,7,6)
DATA24=downsample(Revathi,dr);
spec24=abs(specgram(DATA24));
image(spec24)
title('Revathi')
set(gca,'YTick',0:40:120)
subplot(5,7,13)
DATA25=downsample(Ranjani,dr);
spec25=abs(specgram(DATA25));
image(spec25)
title('Ranjani')
set(gca,'YTick',0:40:120)
subplot(5,7,20)
DATA26=downsample(Varali,dr);
spec26=abs(specgram(DATA26));
image(spec26)
title('Varali')
set(gca,'YTick',0:40:120)
subplot(5,7,27)
DATA27=downsample(Gowlipanthu,dr);
spec27=abs(specgram(DATA27));
image(spec27)
title('Gowlipanthu')
set(gca,'YTick',0:40:120)

% Shokam (Sad)
Subha_Panthuvarali=[x_S x_R1 x_G2 x_M2 x_P x_D1 x_N3 x_S x_S x_S x_N3 x_D1 x_P x_M2 x_G2 x_R1 x_S x_S];
Poorvi_Kalyani=[x_S x_R1 x_G3 x_M2 x_P x_D2 x_P x_S x_S x_S x_N3 x_D2 x_P x_M2 x_G3 x_R1 x_S x_S];
Panthuvarali=[x_S x_R1 x_G3 x_M2 x_P x_D1 x_N3 x_S x_S x_S x_N3 x_D1 x_P x_M2 x_G3 x_R1 x_S x_S];

subplot(5,7,7)
DATA28=downsample(Subha_Panthuvarali,dr);
spec28=abs(specgram(DATA28));
image(spec28)
title('Subha Panthuvarali')
set(gca,'YTick',0:40:120)
subplot(5,7,14)
DATA29=downsample(Poorvi_Kalyani,dr);
spec29=abs(specgram(DATA29));
image(spec29)
title('Poorvi Kalyani')
set(gca,'YTick',0:40:120)
subplot(5,7,21)
DATA30=downsample(Panthuvarali,dr);
spec30=abs(specgram(DATA30));
image(spec30)
title('Panthuvarali')
set(gca,'YTick',0:40:120)

% ham=[x_S x_R2 x_G3 x_P x_N3 x_S x_S x_S x_N3 x_P x_G3 x_R2 x_S x_S];
% kal=[x_S x_R2 x_G3 x_M2 x_P x_D2 x_N3 x_S x_S x_S x_N3 x_D2 x_P x_M2 x_G3 x_R2 x_S x_S];
% bha=[x_S x_G2 x_R2 x_G2 x_M1 x_P x_D2 x_N2 x_S x_S x_S x_N2 x_D1 x_P x_M1 x_G2 x_R2 x_S x_S];
% subplot(5,7,1)
% DATA1=downsample(ham,10);
% spec1=10*log(abs(specgram(DATA1)));
% imagesc(spec1)
% subplot(5,7,8)
% DATA2=downsample(kal,10);
% spec2=10*log(abs(specgram(DATA2)));
% imagesc(spec2)
% subplot(5,7,15)
% DATA3=downsample(bha,10);
% spec3=10*log(abs(specgram(DATA3)));
% imagesc(spec3)
% 
% C=imfuse(spec3,spec2,'ColorChannels',[2 1 2]);
% figure
% imagesc(C)
% 
% B=imfuse(spec1,spec3,'ColorChannels',[1 1 2]);
% figure
% imagesc(B)
% 
% E=imfuse(spec1,spec2,'ColorChannels',[1 2 1]);
% figure
% imagesc(E)
% % sound(bha)
% % y=audiowrite('kalyani','x',fs);
