<jupyter_start><jupyter_text>```matlabfunction [pulse,azerr,elerr] = getNearestUCDpulse(azimuth,elevation,h3D)%   retrieves the impulse response from h3D that is closest to the specified %   azimuth and elevation (in degrees)%   h3D is the array containing all HRTFs for a given subject (left or right)elmax = 50;elindices = 1:elmax;elevations = -45 + 5.625*(elindices-1);azimuths = [-80 -65 -55 -45:5:45 55 65 80];%el est est l'indice du plus proche de l'indicie elevation entréel = round ((elevation+45)/5.625 +1);el= max(el,1);el = min (el,elmax);elerr= el - (elevation+45)/5.625 +1;%azim est l'indice du plus proche de l'indice azimuth entré[azerr, azim] = min (abs(azimuths - azimuth));fprintf('les paramètres utilisés pour la HRTF sont:\n \t azimuth: %i degrés \n \t élevation: %6.3f degrés',azimuths(azim),-45 + 5.625*(el-1));fprintf('\nles indices sont:\n \t azim: %i \n \t el: %d ',azim,el);azimuths(azim);pulse = squeeze(h3D(azim,el,:));```<jupyter_code>elmax = 50
elevations = -45 + 5.625 * np.arange(elmax)
azimuths = np.concatenate(([-80, -65, -55], np.arange(-45, 50, 5), [55, 65, 80]))

def getNearestUCDpulse(azimuth, elevation, filtr):

    # Find closest index for elevation in table
    el = int(np.round(((elevation + 45) / 5.625)))
    el = min(elmax, max(el, 1))
    elerr = el - (elevation + 45) / 5.625
    
    az = np.abs(azimuths - azimuth).argmin()
    azerr = np.abs(azimuths - azimuth)[az]
    
    return filtr[az, el, :], elerr, azerr

getNearestUCDpulse(21, 30, None)
elevations[13]<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.16245954692556636, 'fraction_numerical': 0.06407766990291262, 'mean_word_length': 4.443661971830986, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '66011', 'license': 'MIT', 'n_tokens_mistral': 703, 'n_tokens_neox': 608, 'n_words': 158, 'path': 'tp6/draft.ipynb', 'repo_name': 'alexis-thual/audio-signal-analysis', 'size': '1545'}