function [Ptm_above_ATH, Pnm_above_ATH]= check_maskers(Ptm, Pnm, ATH, b) % [important_tone_maskers, = check_maskers(power_spectral_density_tones, % important_noise_maskers] power_spectral_density_noise, % absolute_threshold_of_hearing, % bark_array) % % check_maskers takes a masker power spectrum and checks to see if values % are above the absolute threshold of hearing (ATH). If not, the masker is % eliminated because you will not hear it anyway. Then, it locates maskers % that have other maskers within their critical bandwidth. If one is % found, the lower of the two is set to zero, because they will not be % detectable by the human ear anyway. % First, take the power spectrum. If any of the values are below corresponding values % of the absolute threshold of hearing, then set them to zero. This is because % it will not be heard anyway! Ptm_above_ATH=Ptm.*(Ptm>ATH); Pnm_above_ATH=Pnm.*(Pnm>ATH); %figure; %subplot(2,1,1); %stem(b, Ptm_above_ATH); %hold on; %plot(b,ATH,'r--'); %xlabel('Frequency (Bark)'); %ylabel('Magnitude'); %title('Ptm above ATH'); %subplot(2,1,2); %stem(b, Pnm_above_ATH); %hold on; %plot(b,ATH,'r--'); %xlabel('Frequency (Bark)'); %ylabel('Magnitude'); %title('Pnm above ATH'); % the remaining maskers must now be checked to see if any are % within a critical bandwidth. If they are, then only the strongest % one matters. The other can be set to zero. % go through masker list for j=1:length(ATH), toneFound=0; noiseFound=0; % was a tone or noise masker found? if (Ptm_above_ATH(j)>0) toneFound=1; %disp([num2str(j),' is a tone.']); end if (Pnm_above_ATH(j)>0) noiseFound=1; %disp([num2str(j),' is noise.']); end % if either masker found if (toneFound | noiseFound) masker_loc_barks = b(j); % determine low and high thresholds of critical bandwidth crit_bw_low = masker_loc_barks-0.5; crit_bw_high = masker_loc_barks+0.5; % determine what indices these values correspond to low_loc = max(find(b