⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 birdswav.m

📁 非常好的数字处理教程
💻 M
📖 第 1 页 / 共 2 页
字号:
			.90 .12 .00 .13 .90 .14 .10 .15 1.00 .16 .10 .17 1.00 .18...			.10 .19 1.00 .20 .10 .21 1.00 .22 .10 .23 1.00 .24 .10 .25...			1.00 .26 .10 .27 1.00 .28 .10 .29 1.00 .30 .10 .31 1.00 .32...			.10 .33 1.00 .34 .10 .35 1.00 .36 .10 .37 1.00 .38 .10 .39...			1.00 .40 .10 .41 1.00 .42 .10 .43 1.00 .44 .10 .45 1.00 .46...			.10 .47 1.00 .48 .10 .49 1.00 .50 .10 .51 1.00 .52 .10 .53...			1.00 .54 .10 .55 1.00 .56 .10 .57 1.00 .58 .10 .59 1.00 .60...			.10 .61 1.00 .62 .10 .63 1.00 .64 .10 .65 1.00 .66 .10 .67...			1.00 .68 .10 .69 1.00 .70 .10 .71 1.00 .72 .10 .73 1.00 .74...			.10 .75 1.00 .76 .10 .77 1.00 .78 .10 .79 1.00 .80 .10 .81...			1.00 .82 .10 .83 1.00 .84 .10 .85 1.00 .86 .10 .87 1.00 .88...			.10 .89 1.00 .90 .10 .91 1.00 .92 .10 .93 1.00 .94 .10 .95...			1.00 .96 .10 .97 1.00 .98 .10 1.00 1.0];grasstwo = [.00 .00 .10 1.00 .20 .00 .30 1.00 .40 .00 .50 1.00 .60 .00...			.70 1.00 .80 .00 .90 1.00 1.00 .0];num_notes = 4;pscore = cell(num_notes,8);pscore(1,:) = {.49 .01 8000 100 .1 grasstwo amp [1 1]};pscore(2,:) = {.60 .01 5700 300 .1 grasstwo amp [1 1]};pscore(3,:) = {.92 .01 3900 100 .1 grasstwo amp [1 1]};pscore(4,:) = {1.00 1.4 6000 2500 .2 grassone amp [1 1]};signal = synth(psynth,Fs,'add');wavwrite(signal,Fs,16,[birdname '.wav']);%%%%%%%%birdname = 'Swamp_Sparrow';fprintf('%s\n', birdname);swamp_up = [.00 .00 .60 .70 1.00 1.0];swamp_down = [.00 1.00 .50 .50 .60 .60 1.00 .0];num_notes = 30;pscore = cell(num_notes,8);pscore(1,:) = {0 .02 3900 200 .3 swamp_up amp partial};pscore(2,:) = {.035 .035 3200 3000 .1 swamp_down amp partial};pscore(3,:) = {.08 .025 3700 0 .1 amp amp partial};pscore(4,:) = {.1 .02 3900 200 .3 swamp_up amp partial};pscore(5,:) = {.135 .035 3200 3000 .1 swamp_down amp partial};pscore(6,:) = {.18 .025 3700 0 .1 amp amp partial};pscore(7,:) = {.2 .02 3900 200 .3 swamp_up amp partial};pscore(8,:) = {.235 .035 3200 3000 .1 swamp_down amp partial};pscore(9,:) = {.28 .025 3700 0 .1 amp amp partial};pscore(10,:) = {.3 .02 3900 200 .3 swamp_up amp partial};pscore(11,:) = {.335 .035 3200 3000 .1 swamp_down amp partial};pscore(12,:) = {.38 .025 3700 0 .1 amp amp partial};pscore(13,:) = {.4 .02 3900 200 .3 swamp_up amp partial};pscore(14,:) = {.435 .035 3200 3000 .1 swamp_down amp partial};pscore(15,:) = {.48 .025 3700 0 .1 amp amp partial};pscore(16,:) = {.5 .02 3900 200 .3 swamp_up amp partial};pscore(17,:) = {.535 .035 3200 3000 .1 swamp_down amp partial};pscore(18,:) = {.58 .025 3700 0 .1 amp amp partial};pscore(19,:) = {.6 .02 3900 200 .3 swamp_up amp partial};pscore(20,:) = {.635 .035 3200 3000 .1 swamp_down amp partial};pscore(21,:) = {.68 .025 3700 0 .1 amp amp partial};pscore(22,:) = {.7 .02 3900 200 .3 swamp_up amp partial};pscore(23,:) = {.735 .035 3200 3000 .1 swamp_down amp partial};pscore(24,:) = {.78 .025 3700 0 .1 amp amp partial};pscore(25,:) = {.8 .02 3900 200 .3 swamp_up amp partial};pscore(26,:) = {.835 .035 3200 3000 .1 swamp_down amp partial};pscore(27,:) = {.88 .025 3700 0 .1 amp amp partial};pscore(28,:) = {.9 .02 3900 200 .3 swamp_up amp partial};pscore(29,:) = {.935 .035 3200 3000 .1 swamp_down amp partial};pscore(30,:) = {.98 .025 3700 0 .1 amp amp partial};signal = synth(psynth,Fs,'add');wavwrite(signal,Fs,16,[birdname '.wav']);%%%%%%%%birdname = 'Golden_Crowned_Sparrow';fprintf('%s\n', birdname);goldone = [.00 1.00 .25 .20 1.00 .0];goldtwo = [.00 .90 .05 1.00 .10 .40 1.00 .0];goldtrill = [.00 .50 .10 .00 .20 1.00 .30 .00 .40 1.00 .50 .00 .60 1.00 ...			.70 .00 .80 1.00 .90 .00 1.00 .50];num_notes = 4;pscore = cell(num_notes,8);pscore(1,:) = {.6 .5 4300 1000 .15 goldone amp partial};pscore(2,:) = {1.3 .45 3300 200 .15 goldone amp partial};pscore(3,:) = {1.75 .4 3800 100 .15 goldtwo amp partial};pscore(4,:) = {2.2 .3 3800 100 .1 goldtrill amp partial};signal = synth(psynth,Fs,'add');wavwrite(signal,Fs,16,[birdname '.wav']);%%%%%%%%birdname = 'Indigo_Bunting';fprintf('%s\n', birdname);buntdwn =[.00 1.00 1.00 .0];buntv =[.00 .00 .50 1.00 1.00 .0];bunty =[.00 1.00 .50 .00 1.00 .90 ];buntn =[.00 .80 .30 1.00 .70 .20 1.00 .0];buntx =[.00 1.00 .10 .50 .25 .90 1.00 .0];buntup =[.00 .00 1.00 1.0];num_notes = 19;pscore = cell(num_notes,8);pscore(1,:) = {.4 .08 3000 700 .25 buntdwn amp partial};pscore(2,:) = {.52 .02 6200 1000 .05 buntdwn amp partial};pscore(3,:) = {.55  .15 3500 2300 .1 buntv amp partial};pscore(4,:) = {.74 .02 6200 1800 .05 buntx amp partial};pscore(5,:) = {.80 .15 3400 2300 .1 buntv amp partial};pscore(6,:) = {1.00 .1 3400 800 .2 buntv amp partial};pscore(7,:) = {1.13 .03 4100 2000 .05 buntdwn amp partial};pscore(8,:) = {1.25 .08 3400 800 .2 buntv amp partial};pscore(9,:) = {1.40 .03 4100 2000 .05 buntdwn amp partial};pscore(10,:) = {1.5 .07 3700 300 .1 buntdwn amp partial};pscore(11,:) = {1.6 .1  4100 2200 .15 bunty amp partial};pscore(12,:) = {1.72 .05 3700 300 .1 buntdwn amp partial};pscore(13,:) = {1.81 .1  4100 2200 .15 bunty amp partial};pscore(14,:) = {1.94 .07 5200 1800 .2 buntn amp partial};pscore(15,:) = {2.05 .08 3000 1500 .15 buntup amp partial};pscore(16,:) = {2.20 .07 5200 1800 .2 buntn amp partial};pscore(17,:) = {2.33 .08 3000 1500 .15 buntup amp partial};pscore(18,:) = {2.43 .07 5200 1800 .1 buntn amp partial};pscore(19,:) = {2.51 .08 3000 1500 .10 buntup amp partial};signal = synth(psynth,Fs,'add');wavwrite(signal,Fs,16,[birdname '.wav']);%%%%%%%%birdname = 'Robin';fprintf('%s\n', birdname);r_one = [.00 .10 .08 .70 .30 .00 .35 1.00 .40 .30 1.00 .30];r_two =[.00 .00 .10 1.00 .20 .70 .35 .70 .65 .30 .70 .50 .80 .00...			.90 .20 1.00 .0];r_three =[.00 .20 .25 1.00 .60 .70 .90 .00 1.00 .10];r_four =[.00 1.00 1.00 .0];r_five =[.00 .50 .10 .00 .20 1.00 .30 .00 .40 1.00 .50 .00 .60 1.00 ...			.70 .50 1.00 .20];r_six =[.00 .00 .12 .70 .30 .00 .70 1.00 1.00 .50];partials = [1 1 2 .1];num_notes = 6;pscore = cell(num_notes,8);pscore(1,:) = {.45 .06 2000 800 .15 r_six amp partials};pscore(2,:) = {.56 .10 2000 900 .15 r_one amp partials};pscore(3,:) = {1.04 .24 2000 2000 .25 r_two amp partials};pscore(4,:) = {1.63 .13 1900 1600 .20 r_three amp partials};pscore(5,:) = {1.80 .11 2200 1200 .25 r_four amp partials};pscore(6,:) = {2.31 .21 1950 2000 .15 r_five amp partials};signal = synth(psynth,Fs,'add');wavwrite(signal,Fs,16,[birdname '.wav']);%%%%%%%%birdname = 'Nashville_Warbler';fprintf('%s\n', birdname);nash_blip = [.00 .60 .35 1.00 1.00 .0];nash_down =[.00 .90 .05 1.00 .10 .90 .65 .50 1.00 .0];nash_up =[.00 .00 .15 .20 .25 .05 .90 .95 1.00 1.0];nash_amp =[.00 .00 .80 1.00 1.00 .0];num_notes = 13;pscore = cell(num_notes,8);pscore(1,:) = {.15 .025 3900 300 .3 nash_blip amp partial};pscore(2,:) = {.24 .16 4200 3800 .15 nash_down nash_amp partial};pscore(3,:) = {.42 .025 3900 300 .3 nash_blip amp partial};pscore(4,:) = {.55 .14 4300 3700 .15 nash_down nash_amp partial};pscore(5,:) = {.75 .03 3950 350 .3 nash_blip amp partial};pscore(6,:) = {.81 .17 4200 3900 .175 nash_down amp partial};pscore(7,:) = {1.0 .02 3800 400 .25 nash_blip amp partial};pscore(8,:) = {1.11 .14 4200 3800 .165 nash_down nash_amp partial};pscore(9,:) = {1.3 .03 3750 300 .2 nash_blip amp partial};pscore(10,:) = {1.4 .11 4200 3700 .1 nash_down amp partial};pscore(11,:) = {1.57 .1 3800 2200 .1 nash_up amp partial};pscore(12,:) = {1.7 .1 3800 2150 .125 nash_up amp partial};pscore(13,:) = {1.85 .075 3900 1800 .1 nash_up nash_amp partial};signal = synth(psynth,Fs,'add');wavwrite(signal,Fs,16,[birdname '.wav']);%%%%%%%%birdname = 'Rufous_Sided_Towhee';fprintf('%s\n', birdname);towhee_one =[.00 .10 .02 .05 .04 .15 .06 .05 .08 .20 .10 .04 .12...		.25 .14 .03 .16 .30 .18 .02 .20 .35 .22 .01 .24 .40 .26...		.00 .28 .45 .30 .00 .32 .50 .34 .00 .36 .50 .80 1.00 1.00 .0];towhee_two =[.00 .00 1.00 1.0];towhee_three =[.00 1.00 1.00 .0];num_notes = 4;pscore = cell(num_notes,8);pscore(1,:) = {.25 .13 1400 1100 .2 towhee_one amp [1 .03 2 1 3 .03]};pscore(2,:) = {.45 .13 1400 1100 .2 towhee_one amp [1 .03 2 1 3 .03]};pscore(3,:) = {.60 .13 1400 1100 .2 towhee_one amp [1 .03 2 1 3 .03]};pscore(4,:) = {.75 .10 1400 1100 .2 towhee_one amp [1 .03 2 1 3 .03]};pscore(5,:) = {.88 .01 5100 2000 .1 towhee_two amp partial};pscore(6,:) = {.895 .01 5100 1600 .1 towhee_two amp partial};pscore(7,:) = {.91 .01 5100 1000 .1 towhee_two amp partial};pscore(8,:) = {.93 .01 3000 1200 .1 towhee_three amp partial};pscore(9,:) = {.945 .01 5100 2000 .09 towhee_two amp partial};pscore(10,:) = {.96 .01 5100 1600 .09 towhee_two amp partial};pscore(11,:) = {.975 .01 5100 1000 .09 towhee_two amp partial};pscore(12,:) = {.995 .01 3000 1200 .09 towhee_three amp partial};pscore(13,:) = {1.01 .01 5100 2000 .1 towhee_two amp partial};pscore(14,:) = {1.025 .01 5100 1600 .1 towhee_two amp partial};pscore(15,:) = {1.04 .01 5100 1000 .1 towhee_two amp partial};pscore(16,:) = {1.06 .01 3000 1200 .1 towhee_three amp partial};pscore(17,:) = {1.075 .01 5100 2000 .09 towhee_two amp partial};pscore(18,:) = {1.09 .01 5100 1600 .09 towhee_two amp partial};pscore(19,:) = {1.105 .01 5100 1000 .09 towhee_two amp partial};pscore(20,:) = {1.125 .01 3000 1200 .09 towhee_three amp partial};pscore(21,:) = {1.14 .01 5100 2000 .08 towhee_two amp partial};pscore(22,:) = {1.155 .01 5100 1600 .08 towhee_two amp partial};pscore(23,:) = {1.17 .01 5100 1000 .08 towhee_two amp partial};pscore(24,:) = {1.19 .01 3000 1200 .08 towhee_three amp partial};pscore(25,:) = {1.205 .01 5100 2000 .08 towhee_two amp partial};pscore(26,:) = {1.220 .01 5100 1600 .08 towhee_two amp partial};pscore(27,:) = {1.235 .01 5100 1000 .08 towhee_two amp partial};pscore(28,:) = {1.255 .01 3000 1200 .08 towhee_three amp partial};pscore(29,:) = {1.27 .01 5100 2000 .07 towhee_two amp partial};pscore(30,:) = {1.285 .01 5100 1600 .07 towhee_two amp partial};pscore(31,:) = {1.30 .01 5100 1000 .07 towhee_two amp partial};pscore(32,:) = {1.32 .01 3000 1200 .07 towhee_three amp partial};pscore(33,:) = {1.335 .01 5100 2000 .06 towhee_two amp partial};pscore(34,:) = {1.350 .01 5100 1600 .06 towhee_two amp partial};pscore(35,:) = {1.365 .01 5100 1000 .06 towhee_two amp partial};pscore(36,:) = {1.385 .01 3000 1200 .06 towhee_three amp partial};pscore(37,:) = {1.400 .01 5100 2000 .05 towhee_two amp partial};pscore(38,:) = {1.415 .01 5100 1600 .05 towhee_two amp partial};pscore(39,:) = {1.430 .01 5100 1000 .05 towhee_two amp partial};pscore(40,:) = {1.45 .01 3000 1200 .05 towhee_three amp partial};pscore(41,:) = {1.465 .01 5100 2000 .03 towhee_two amp partial};pscore(42,:) = {1.480 .01 5100 1600 .03 towhee_two amp partial};pscore(43,:) = {1.495 .01 5100 1000 .03 towhee_two amp partial};pscore(44,:) = {1.515 .01 3000 1200 .03 towhee_three amp partial};signal = synth(psynth,Fs,'add');wavwrite(signal,Fs,16,[birdname '.wav']);%%%%%%%%birdname = 'Random_Bird';fprintf('%s\n', birdname);freq_envelopes = {yellow_up yellow_swirl yellow_down yellow_last ...		no_skw down_skw fas_down oriup oridwn oriupdwna oriupdwnb ...		oribiga orimid oridwnup grayone graytwo graythree grayfour ...		kingfirst kingsecond rampup ycurve vcurve wcurve upcurve ...		downcurve owlup owldown grassone grasstwo swamp_up swamp_down ...		goldone goldtwo goldtrill buntdwn buntv bunty buntn buntx ...		buntup r_one r_two r_three r_four r_five r_six nash_blip ...		nash_down nash_up towhee_one towhee_two towhee_three chip_up};amp_envelopes = {amp swirl_amp oriamp scissor upamp louder wamp ...		nash_amp bird_amp tap};partials = {[1 1] [1 1 2 .04] [1 1 2 .02 3 .05] [1 1 2 .5 3 0 4 .2] ... 	[1 1 2 .01 3 0 4 .1] [1 1 2 .1] [1 1 3 .02 7 .01] [1 .03 2 1 3 .03]};num_notes = 15;pscore = cell(num_notes,8);beg = 0;dur = 0;for i=1:num_notes,	beg = beg + dur + rand*0.2;	dur = rand*0.2 + 0.05;	freq = 1000 + 2000*rand;	freqskew = rand*freq/2;	amplitude = rand*0.5;	freq_env = freq_envelopes{floor(rand*size(freq_envelopes,2))+1};	amp_env = amp_envelopes{floor(rand*size(amp_envelopes,2))+1};	partial = partials{floor(rand*size(partials,2))+1};	pscore(i,:) = {beg dur freq freqskew amplitude freq_env amp_env partial};	fprintf(['\tbeg=%3.2f dur=%3.2f freq=%4.2f freqskew=%4.2f ' ...			'amp=%3.2f\n'],beg,dur,freq,freqskew,amplitude);	fprintf('%d\tamp_env = [',i);	for j=1:size(amp_env,2),		fprintf('%2.2f ',amp_env(j));	end	fprintf(']\n');	fprintf('\tfreq_env = [');	for j=1:size(freq_env,2),		fprintf('%2.2f ',freq_env(j));	end	fprintf(']\n');	fprintf('\tpartial = [');	for j=1:size(partial,2),		fprintf('%2.2f ',partial(j));	end	fprintf(']\n\n');endsignal = synth(psynth,Fs,'add');wavwrite(signal,Fs,16,[birdname '.wav']);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -