To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.
The primary repository for this project is hosted at git://github.com/rmeddis/MAP.git .
This repository is a read-only copy which is updated automatically every hour.
root / userProgramsTim / speech_stimuli_check.m @ 38:c2204b18f4a2
History | View | Annotate | Download (6.82 KB)
| 1 | 38:c2204b18f4a2 | rmeddis | %skript to test several stimuli with MAP1_14 |
|---|---|---|---|
| 2 | % Tim Juergens, September 2011 |
||
| 3 | |||
| 4 | %addpath('C:\Documents and Settings\tjurgens\My Documents\Dropbox\matlab');
|
||
| 5 | addpath('C:\MAP\userPrograms');
|
||
| 6 | parameterfile='Normal'; |
||
| 7 | |||
| 8 | %Read the wavfiles |
||
| 9 | [da,sfreq] = wavread('..\wavFileStore\new-da-44khz.wav'); %artificial stimulus
|
||
| 10 | ba = wavread('..\wavFileStore\new-ba-44khz.wav'); %artificial stimulus
|
||
| 11 | |||
| 12 | %set level of speech stimuli (RMS 1 equals 94 dB) |
||
| 13 | da_69dB = da./sqrt(mean(da.^2)).*10^(-(94-69)/20); |
||
| 14 | da_49dB = da./sqrt(mean(da.^2)).*10^(-(94-49)/20); |
||
| 15 | ba_69dB = ba./sqrt(mean(ba.^2)).*10^(-(94-69)/20); |
||
| 16 | %20*log10(sqrt(mean(ba_69dB.^2))/20e-6) %reference pressure: 20uPa |
||
| 17 | |||
| 18 | |||
| 19 | cd .. |
||
| 20 | cd MAP |
||
| 21 | |||
| 22 | %MAP and store AN output of HSR fibers in variables |
||
| 23 | MAP1_14(da_69dB,sfreq,-1,parameterfile,'probability'); |
||
| 24 | global ANprobRateOutput |
||
| 25 | AN_da_69dB = ANprobRateOutput(1:size(ANprobRateOutput,1)/2,:); |
||
| 26 | |||
| 27 | MAP1_14(da_49dB,sfreq,-1,parameterfile,'probability'); |
||
| 28 | global ANprobRateOutput |
||
| 29 | AN_da_49dB = ANprobRateOutput(1:size(ANprobRateOutput,1)/2,:); |
||
| 30 | % |
||
| 31 | MAP1_14(ba_69dB,sfreq,-1,parameterfile,'probability'); |
||
| 32 | global ANprobRateOutput |
||
| 33 | global savedBFlist |
||
| 34 | AN_ba_69dB = ANprobRateOutput(1:size(ANprobRateOutput,1)/2,:); |
||
| 35 | |||
| 36 | %Do the IPIH analysis |
||
| 37 | [iih_da_69dB,IPIhisttime_da_69dB,IPIhistweight_da_69dB] = track_formants_from_IPI_guy(AN_da_69dB,sfreq); |
||
| 38 | %[iih_da_69dB,IPIhisttime_da_69dB,IPIhistweight_da_69dB] = IPIHextract(AN_da_69dB,sfreq); |
||
| 39 | poolIPI_across_channels(IPIhisttime_da_69dB,IPIhistweight_da_69dB); |
||
| 40 | map_iih_onto_log(iih_da_69dB,30,sfreq); |
||
| 41 | [iih_da_49dB,IPIhisttime_da_49dB,IPIhistweight_da_49dB] = track_formants_from_IPI_guy(AN_da_49dB,sfreq); |
||
| 42 | % poolIPI_across_channels(IPIhisttime_da_49dB,IPIhistweight_da_49dB); |
||
| 43 | % |
||
| 44 | [iih_ba_69dB,IPIhisttime_ba_69dB,IPIhistweight_ba_69dB] = track_formants_from_IPI_guy(AN_ba_69dB,sfreq); |
||
| 45 | % [tmp,ctr]=poolIPI_across_channels(IPIhisttime_ba_69dB,IPIhistweight_ba_69dB); |
||
| 46 | % |
||
| 47 | |||
| 48 | |||
| 49 | |||
| 50 | %%%%%% OLLO stimuli %%%%%%%%%%%%%%%%% |
||
| 51 | % OLLOwavfiles = {'dahd','bahb','dehd','behb','died','bieb','dohd','bohb','duhd','buhb','atta','ascha','assa'};
|
||
| 52 | % OLLO_level = 69; %level of OLLO files in dB SPL |
||
| 53 | % paramChanges = [];%{'DRNLParams.rateToAttenuationFactorProb = 0;'};
|
||
| 54 | % |
||
| 55 | % for iCounter = 1:length(OLLOwavfiles) |
||
| 56 | % |
||
| 57 | % %read the stimuli |
||
| 58 | % eval(['[' OLLOwavfiles{iCounter} ',sfreq_OLLO] = wavread([''..\wavFileStore\S02M_L' ...
|
||
| 59 | % sprintf('%3.3i',sloga2iloga(OLLOwavfiles{iCounter})) '_V6_M1_N2_CS0.wav'']);'])
|
||
| 60 | % |
||
| 61 | % %delete preceding and subsequent silence and resample to 44100 Hz |
||
| 62 | % %sampling frequency |
||
| 63 | % eval([OLLOwavfiles{iCounter} ' = cutsignal(' OLLOwavfiles{iCounter} ',sfreq_OLLO,''d_d'');']);
|
||
| 64 | % eval([OLLOwavfiles{iCounter} ' = resample(' OLLOwavfiles{iCounter} ',sfreq,sfreq_OLLO);']);
|
||
| 65 | % |
||
| 66 | % %set level |
||
| 67 | % partfilename = [OLLOwavfiles{iCounter} num2str(OLLO_level) 'dB'];
|
||
| 68 | % eval([partfilename ' = ' OLLOwavfiles{iCounter} ...
|
||
| 69 | % './sqrt(mean(' OLLOwavfiles{iCounter} '.^2)).*10^(-(94-' num2str(OLLO_level) ')/20);']);
|
||
| 70 | % |
||
| 71 | % %use MAP |
||
| 72 | % eval(['MAP1_14(' partfilename ',sfreq,-1,parameterfile,''probability'', paramChanges );']);
|
||
| 73 | % global ANprobRateOutput |
||
| 74 | % eval(['AN_' partfilename ' = ANprobRateOutput(1:size(ANprobRateOutput,1)/2,:);']); |
||
| 75 | % |
||
| 76 | % %Do the IPIH analysis |
||
| 77 | % eval(['[iih_' partfilename ',IPIhisttime_' partfilename ',IPIhistweight_' ... |
||
| 78 | % partfilename '] = track_formants_from_IPI_guy(AN_' partfilename ',sfreq);']); |
||
| 79 | % eval(['poolIPI_across_channels(IPIhisttime_' partfilename ',IPIhistweight_' partfilename ');']); |
||
| 80 | % title(partfilename); |
||
| 81 | % %set(gca,'Title',partfilename); |
||
| 82 | % xlabel('Interval (ms)')
|
||
| 83 | % ylabel('Stimulus time (ms)');
|
||
| 84 | % |
||
| 85 | % eval(['map_iih_onto_log(iih_' partfilename ',30,sfreq);']); |
||
| 86 | % title(partfilename); |
||
| 87 | % end |
||
| 88 | |||
| 89 | |||
| 90 | %%%%%%%%%%%%% OLLO stimuli from different speakers |
||
| 91 | % OLLOwavfiles = {'S01F_L111_V6_M1_N2_CS0.wav','S02M_L111_V6_M1_N2_CS0.wav'};
|
||
| 92 | % OLLO_level = 69; %level of OLLO files in dB SPL |
||
| 93 | % for iCounter = 1:length(OLLOwavfiles) |
||
| 94 | % |
||
| 95 | % partfilename = [OLLOwavfiles{iCounter}(1:end-4) num2str(OLLO_level) 'dB'];
|
||
| 96 | % %read the stimuli |
||
| 97 | % eval(['[' partfilename ',sfreq_OLLO] = wavread([''..\wavFileStore\' OLLOwavfiles{iCounter} ''']);'])
|
||
| 98 | % |
||
| 99 | % %delete preceding and subsequent silence and resample to 44100 Hz |
||
| 100 | % %sampling frequency |
||
| 101 | % eval([partfilename ' = cutsignal(' partfilename ',sfreq_OLLO,''d_d'');']);
|
||
| 102 | % eval([partfilename ' = resample(' partfilename ',sfreq,sfreq_OLLO);']);
|
||
| 103 | % |
||
| 104 | % %set level |
||
| 105 | % |
||
| 106 | % eval([partfilename ' = ' partfilename ... |
||
| 107 | % './sqrt(mean(' partfilename '.^2)).*10^(-(94-' num2str(OLLO_level) ')/20);']);
|
||
| 108 | % |
||
| 109 | % %use MAP |
||
| 110 | % eval(['MAP1_14(' partfilename ',sfreq,-1,parameterfile,''probability'');']);
|
||
| 111 | % global ANprobRateOutput |
||
| 112 | % eval(['AN_' partfilename ' = ANprobRateOutput(1:size(ANprobRateOutput,1)/2,:);']); |
||
| 113 | % |
||
| 114 | % %Do the IPIH analysis |
||
| 115 | % eval(['[iih_' partfilename ',IPIhisttime_' partfilename ',IPIhistweight_' ... |
||
| 116 | % partfilename '] = track_formants_from_IPI_guy(AN_' partfilename ',sfreq);']); |
||
| 117 | % eval(['poolIPI_across_channels(IPIhisttime_' partfilename ',IPIhistweight_' partfilename ');']); |
||
| 118 | % title(partfilename); |
||
| 119 | % %set(gca,'Title',partfilename); |
||
| 120 | % xlabel('Interval (ms)')
|
||
| 121 | % ylabel('Stimulus time (ms)');
|
||
| 122 | % |
||
| 123 | % eval(['map_iih_onto_log(iih_' partfilename ',30,sfreq);']); |
||
| 124 | % title(partfilename); |
||
| 125 | % end |
||
| 126 | |||
| 127 | |||
| 128 | |||
| 129 | %%%%%% da stimuli with different pitches %%%%%%%%%%%%%%%%% |
||
| 130 | |||
| 131 | dawavfiles = { '200ms_da_080Hz.wav','200ms_da_100Hz.wav','200ms_da_120Hz.wav','200ms_da_140Hz.wav', ...
|
||
| 132 | '200ms_da_160Hz.wav','200ms_da_180Hz.wav','200ms_da_200Hz.wav','200ms_da_220Hz.wav', ... |
||
| 133 | '200ms_da_240Hz.wav', ... |
||
| 134 | 'noise.wav', ... |
||
| 135 | 'da_whispered.wav', ... |
||
| 136 | }; |
||
| 137 | |||
| 138 | da_level = 69; %level of OLLO files in dB SPL |
||
| 139 | for iCounter = 1:length(dawavfiles) |
||
| 140 | |||
| 141 | %read the stimuli |
||
| 142 | partfilename = ['da' dawavfiles{iCounter}(1:end-4)];
|
||
| 143 | eval([ partfilename ' = wavread(''..\wavFileStore\' dawavfiles{iCounter} ''');'])
|
||
| 144 | |||
| 145 | %set level |
||
| 146 | eval([partfilename ' = ' partfilename ... |
||
| 147 | './sqrt(mean(' partfilename '.^2)).*10^(-(94-' num2str(da_level) ')/20);']);
|
||
| 148 | |||
| 149 | %use MAP |
||
| 150 | eval(['MAP1_14(' partfilename ',sfreq,-1,parameterfile,''probability'');']);
|
||
| 151 | global ANprobRateOutput |
||
| 152 | eval(['AN_' partfilename ' = ANprobRateOutput(1:size(ANprobRateOutput,1)/2,:);']); |
||
| 153 | |||
| 154 | %Do the IPIH analysis |
||
| 155 | eval(['[iih_' partfilename ',IPIhisttime_' partfilename ',IPIhistweight_' ... |
||
| 156 | partfilename '] = IPIHextract(AN_' partfilename ',sfreq);']);%partfilename '] = track_formants_from_IPI_guy(AN_' partfilename ',sfreq);']);% |
||
| 157 | eval(['poolIPI_across_channels(IPIhisttime_' partfilename ',IPIhistweight_' partfilename ');']); |
||
| 158 | title(partfilename); |
||
| 159 | %set(gca,'Title',partfilename); |
||
| 160 | xlabel('Interval (ms)')
|
||
| 161 | ylabel('Stimulus time (ms)');
|
||
| 162 | |||
| 163 | eval(['map_iih_onto_log(iih_' partfilename ',30,sfreq);']); |
||
| 164 | title(partfilename); |
||
| 165 | end |
||
| 166 | % |
||
| 167 | % |