{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/exact-parallelizable-dynamic-time-warping","title":"Exact, Parallelizable Dynamic Time Warping Alignment with Linear Memory","arxiv_id":"2008.02734","date":"2020-08-04","proceeding":null,"authors":["Christopher Tralie","Elizabeth Dempsey"],"abstract":"Audio alignment is a fundamental preprocessing step in many MIR pipelines. For two audio clips with M and N frames, respectively, the most popular approach, dynamic time warping (DTW), has O(MN) requirements in both memory and computation, which is prohibitive for frame-level alignments at reasonable rates. To address this, a variety of memory efficient algorithms exist to approximate the optimal alignment under the DTW cost. To our knowledge, however, no exact algorithms exist that are guaranteed to break the quadratic memory barrier. In this work, we present a divide and conquer algorithm that computes the exact globally optimal DTW alignment using O(M+N) memory. Its runtime is still O(MN), trading off memory for a 2x increase in computation. However, the algorithm can be parallelized up to a factor of min(M, N) with the same memory constraints, so it can still run more efficiently than the textbook version with an adequate GPU. We use our algorithm to compute exact alignments on a collection of orchestral music, which we use as ground truth to benchmark the alignment accuracy of several popular approximate alignment schemes at scales that were not previously possible.","url_abs":"https://arxiv.org/abs/2008.02734v1","url_pdf":"https://arxiv.org/pdf/2008.02734v1.pdf","source":{"archive":"pwc-archive (Hugging Face), CC BY-SA 4.0","snapshot":"2025-07-28","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","row_kind":"abstracts"},"code_links":[{"paper_slug":"exact-parallelizable-dynamic-time-warping","repo_url":"https://github.com/ctralie/linmdtw","is_official":1,"mentioned_in_paper":1,"mentioned_in_github":0,"framework":"none","reach":{"status":"ok","spdx":"Apache-2.0"}}],"tasks":[{"task_slug":"dynamic-time-warping","task_name":"Dynamic Time Warping"},{"task_slug":null,"task_name":"GPU"}],"methods":[{"method_slug":"dtw","method_name":"DTW"}],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2008.02734","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2008.02734"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"provenance":"external:paperswithcode_snapshot_2025-07-28","url":"https://github.com/ctralie/linmdtw","reach":{"status":"ok","spdx":"Apache-2.0"}}],"summary":{"unverified":12},"by_repo_kind":{"official":{"samples":12,"ran":0,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":0,"samples":[{"code_sha256_prefix":"6e77c3c39b1aada7","entry":"check_euclidean_inputs","repo":"ctralie/linmdtw","repo_kind":"official","path":"linmdtw/dtw.py","file_url":"https://github.com/ctralie/linmdtw/blob/HEAD/linmdtw/dtw.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"6e77c3c39b1aada7"}},{"code_sha256_prefix":"a18c55fc4badbe56","entry":"dtw_brute","repo":"ctralie/linmdtw","repo_kind":"official","path":"linmdtw/dtw.py","file_url":"https://github.com/ctralie/linmdtw/blob/HEAD/linmdtw/dtw.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"a18c55fc4badbe56"}},{"code_sha256_prefix":"5ceaca38a267b7cc","entry":"dtw_brute_backtrace","repo":"ctralie/linmdtw","repo_kind":"official","path":"linmdtw/dtw.py","file_url":"https://github.com/ctralie/linmdtw/blob/HEAD/linmdtw/dtw.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"5ceaca38a267b7cc"}},{"code_sha256_prefix":"7b2db475a8bb953d","entry":"dtw_diag_gpu","repo":"ctralie/linmdtw","repo_kind":"official","path":"linmdtw/dtwgpu.py","file_url":"https://github.com/ctralie/linmdtw/blob/HEAD/linmdtw/dtwgpu.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"7b2db475a8bb953d"}},{"code_sha256_prefix":"abf86360b11c23c3","entry":"get_DLNC0","repo":"ctralie/linmdtw","repo_kind":"official","path":"linmdtw/audiotools.py","file_url":"https://github.com/ctralie/linmdtw/blob/HEAD/linmdtw/audiotools.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"abf86360b11c23c3"}},{"code_sha256_prefix":"f03812450d38974b","entry":"get_box_area","repo":"ctralie/linmdtw","repo_kind":"official","path":"linmdtw/dtwapprox.py","file_url":"https://github.com/ctralie/linmdtw/blob/HEAD/linmdtw/dtwapprox.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"f03812450d38974b"}},{"code_sha256_prefix":"5fa5734371d5cc67","entry":"get_cdf","repo":"ctralie/linmdtw","repo_kind":"official","path":"experiments/paperfigures.py","file_url":"https://github.com/ctralie/linmdtw/blob/HEAD/experiments/paperfigures.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"5fa5734371d5cc67"}},{"code_sha256_prefix":"d884e7c1b6bf2842","entry":"get_csm","repo":"ctralie/linmdtw","repo_kind":"official","path":"linmdtw/alignmenttools.py","file_url":"https://github.com/ctralie/linmdtw/blob/HEAD/linmdtw/alignmenttools.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"d884e7c1b6bf2842"}},{"code_sha256_prefix":"a192a013abe3c322","entry":"get_diag_indices","repo":"ctralie/linmdtw","repo_kind":"official","path":"linmdtw/alignmenttools.py","file_url":"https://github.com/ctralie/linmdtw/blob/HEAD/linmdtw/alignmenttools.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"a192a013abe3c322"}},{"code_sha256_prefix":"185581686f50c2ee","entry":"get_diag_len","repo":"ctralie/linmdtw","repo_kind":"official","path":"linmdtw/alignmenttools.py","file_url":"https://github.com/ctralie/linmdtw/blob/HEAD/linmdtw/alignmenttools.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"185581686f50c2ee"}},{"code_sha256_prefix":"d03d52c6cb252419","entry":"get_mixed_DLNC0_CENS","repo":"ctralie/linmdtw","repo_kind":"official","path":"linmdtw/audiotools.py","file_url":"https://github.com/ctralie/linmdtw/blob/HEAD/linmdtw/audiotools.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"d03d52c6cb252419"}},{"code_sha256_prefix":"5f0af94e039bd318","entry":"load_audio","repo":"ctralie/linmdtw","repo_kind":"official","path":"linmdtw/audiotools.py","file_url":"https://github.com/ctralie/linmdtw/blob/HEAD/linmdtw/audiotools.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"Apache-2.0","inline_ok":true,"mcp_get_code":{"code_sha256":"5f0af94e039bd318"}}]},"arxiv_metadata":null,"syntology_extracted_results":null}