{"id":"dwt_distance","title":"Full Haar coefficient distance","family":"feature-based","definition":"reference","intro_en":"Apply the complete orthonormal Haar transform and compare all coefficients. The animation separates pair averages and details across four levels. With every coefficient retained and no boundary padding, the resulting Euclidean distance equals the raw-sample Euclidean distance by norm preservation.","intro_zh":"进行完整正交 Haar 变换并比较全部系数。动图展示四级相邻点和差分解。保留所有系数且不填充边界时，由范数保持性质，系数的欧氏距离等于原始样本的欧氏距离。","steps_en":["Use equal-length inputs of length 16, so Haar pairs need no padding.","Recursively form orthonormal pair sums and differences at four levels.","Collect all 16 coefficients in [A4,D4,D3,D2,D1] order.","Take their Euclidean distance and verify equality with raw Euclidean distance."],"steps_zh":["使用长度均为 16 的输入，因此相邻点分组无需填充。","递归进行四级正交归一化的相邻点和差分解。","按 [A4,D4,D3,D2,D1] 顺序保留全部 16 个系数。","计算系数欧氏距离，并核对其等于原始欧氏距离。"],"animation_steps_en":["Compute orthonormal Haar pair sums and differences at four levels.","Collect all 16 approximation and detail coefficients.","Accumulate squared differences between matching coefficients.","Verify that coefficient L2 equals raw-sample Euclidean distance."],"formula":"d = ||W_Haar x - W_Haar y||_2 = ||x-y||_2 (complete orthonormal transform)","caveats_en":["Using all orthonormal coefficients does not by itself create a new Euclidean notion of similarity.","Truncating coefficients, weighting scales or changing boundary conventions changes this equivalence."],"caveats_zh":["保留全部正交系数本身不会产生新的欧氏相似性定义。","截断系数、对尺度加权或改变边界约定都会改变上述等价关系。"],"sources":[{"label":"PyWavelets: Haar approximation and detail coefficients","url":"https://pywavelets.readthedocs.io/en/latest/ref/dwt-discrete-wavelet-transform.html"},{"label":"Imported registry: named feature and comparison conventions","url":"https://github.com/ZipengWu365/EchoTime/blob/main/src/echotime/data/ts_similarity_package_v2_registry.csv"},{"label":"Exact illustrative inputs and encoder definitions","url":"https://github.com/ZipengWu365/EchoTime/blob/main/tools/method_animation_data/feature_model_embedding.py"}],"x":[0.0,0.8769216919004693,0.8094744111674236,0.7863961030678929,0.3905255888325767,-0.5769216919004693,-0.6000000000000001,-0.09587051423531628,0.2094744111674235,1.0863961030678926,1.5905255888325764,0.9958705142353173,0.6000000000000002,0.20412948576468337,-0.39052558883257615,0.11360389693210537],"y":[-0.2003300858899106,0.185,0.5703300858899106,1.005,1.0003300858899107,0.3250000000000002,-0.35033008588991066,-0.3550000000000001,0.07966991411008931,0.46499999999999997,0.8503300858899105,1.2849999999999995,1.2803300858899114,0.6050000000000002,-0.07033008588991083,-0.07500000000000043],"input_label":"Deterministic synthetic teaching signals, 16 samples each","parameters":{"wavelet":"orthonormal Haar","length":16,"retained":16,"coefficient_order":"A4,D4,D3,D2,D1","padding":false},"result":{"label":"distance","value":1.9325587219875306,"detail":"Full-coefficient L2; raw Euclidean distance = 1.93255872199."},"frames":[{"phase":0,"caption":"Haar level 1: pair sums form the next approximation.","panel":{"kind":"bars","title":"Level 1 approximation coefficients","a":[0.6200772749124022,1.1284508625114549,-0.13180194846605345,-0.4920547594435621,0.9163188281554904,1.828858223313768,0.568605412336259,-0.1958132062004747],"a_label":"x approximation","b":[-0.010840007688928002,1.113926586339942,0.9371498910433054,-0.49874368670764585,0.3851397897755385,1.5099063838044082,1.3331296885077724,-0.10276388924317963],"b_label":"y approximation"}},{"phase":0,"caption":"Haar level 1: pair differences record detail at this scale.","panel":{"kind":"bars","title":"Level 1 detail coefficients","a":[-0.6200772749124022,0.016318828155490586,0.6840885326468223,-0.356473377980295,-0.620077274912402,0.4204846357147142,0.2799227250875982,-0.3564733779802934],"a_label":"x detail","b":[-0.27246951672795056,-0.30735804384501825,0.4775304832720493,0.0033021279348029804,-0.2724695167279506,-0.307358043845018,0.4775304832720497,0.0033021279348030984],"b_label":"y detail"}},{"phase":0,"caption":"Haar level 2: pair sums form the next approximation.","panel":{"kind":"bars","title":"Level 2 approximation coefficients","a":[1.2363961030678927,-0.4411333086516044,1.9411333086516043,0.26360389693210634],"a_label":"x approximation","b":[0.7799999999999998,0.31,1.3399999999999994,0.8699999999999999],"b_label":"y approximation"}},{"phase":0,"caption":"Haar level 2: pair differences record detail at this scale.","panel":{"kind":"bars","title":"Level 2 detail coefficients","a":[-0.3594744111674235,0.2547372055837118,-0.6452627944162886,0.5405255888325771],"a_label":"x detail","b":[-0.7953300858899103,1.0153300858899106,-0.7953300858899103,1.0153300858899112],"b_label":"y detail"}},{"phase":0,"caption":"Haar level 3: pair sums form the next approximation.","panel":{"kind":"bars","title":"Level 3 approximation coefficients","a":[0.5623357147571206,1.558984628802521],"a_label":"x approximation","b":[0.7707463914933367,1.5627059864222692],"b_label":"y approximation"}},{"phase":0,"caption":"Haar level 4: pair sums form the next approximation.","panel":{"kind":"bars","title":"Level 4 approximation coefficients","a":[1.4999999999999996],"a_label":"x approximation","b":[1.6499999999999992],"b_label":"y approximation"}},{"phase":1,"caption":"Expose 1 of 16 coordinates; each has the same meaning in x and y.","panel":{"kind":"bars","title":"Full orthonormal Haar vectors","a":[1.4999999999999996],"a_label":"x features","b":[1.6499999999999992],"b_label":"y features","labels":["A4"],"marker":0}},{"phase":1,"caption":"Expose 4 of 16 coordinates; each has the same meaning in x and y.","panel":{"kind":"bars","title":"Full orthonormal Haar vectors","a":[1.4999999999999996,-0.7047372055837111,1.186192422666736,1.1861924226667366],"a_label":"x features","b":[1.6499999999999992,-0.5599999999999995,0.33234018715767716,0.332340187157677],"b_label":"y features","labels":["A4","D4","D3a","D3b"],"marker":3}},{"phase":1,"caption":"Expose 7 of 16 coordinates; each has the same meaning in x and y.","panel":{"kind":"bars","title":"Full orthonormal Haar vectors","a":[1.4999999999999996,-0.7047372055837111,1.186192422666736,1.1861924226667366,-0.3594744111674235,0.2547372055837118,-0.6452627944162886],"a_label":"x features","b":[1.6499999999999992,-0.5599999999999995,0.33234018715767716,0.332340187157677,-0.7953300858899103,1.0153300858899106,-0.7953300858899103],"b_label":"y features","labels":["A4","D4","D3a","D3b","D20","D21","D22"],"marker":6}},{"phase":1,"caption":"Expose 10 of 16 coordinates; each has the same meaning in x and y.","panel":{"kind":"bars","title":"Full orthonormal Haar vectors","a":[1.4999999999999996,-0.7047372055837111,1.186192422666736,1.1861924226667366,-0.3594744111674235,0.2547372055837118,-0.6452627944162886,0.5405255888325771,-0.6200772749124022,0.016318828155490586],"a_label":"x features","b":[1.6499999999999992,-0.5599999999999995,0.33234018715767716,0.332340187157677,-0.7953300858899103,1.0153300858899106,-0.7953300858899103,1.0153300858899112,-0.27246951672795056,-0.30735804384501825],"b_label":"y features","labels":["A4","D4","D3a","D3b","D20","D21","D22","D23","D10","D11"],"marker":9}},{"phase":1,"caption":"Expose 13 of 16 coordinates; each has the same meaning in x and y.","panel":{"kind":"bars","title":"Full orthonormal Haar vectors","a":[1.4999999999999996,-0.7047372055837111,1.186192422666736,1.1861924226667366,-0.3594744111674235,0.2547372055837118,-0.6452627944162886,0.5405255888325771,-0.6200772749124022,0.016318828155490586,0.6840885326468223,-0.356473377980295,-0.620077274912402],"a_label":"x features","b":[1.6499999999999992,-0.5599999999999995,0.33234018715767716,0.332340187157677,-0.7953300858899103,1.0153300858899106,-0.7953300858899103,1.0153300858899112,-0.27246951672795056,-0.30735804384501825,0.4775304832720493,0.0033021279348029804,-0.2724695167279506],"b_label":"y features","labels":["A4","D4","D3a","D3b","D20","D21","D22","D23","D10","D11","D12","D13","D14"],"marker":12}},{"phase":1,"caption":"Expose 16 of 16 coordinates; each has the same meaning in x and y.","panel":{"kind":"bars","title":"Full orthonormal Haar vectors","a":[1.4999999999999996,-0.7047372055837111,1.186192422666736,1.1861924226667366,-0.3594744111674235,0.2547372055837118,-0.6452627944162886,0.5405255888325771,-0.6200772749124022,0.016318828155490586,0.6840885326468223,-0.356473377980295,-0.620077274912402,0.4204846357147142,0.2799227250875982,-0.3564733779802934],"a_label":"x features","b":[1.6499999999999992,-0.5599999999999995,0.33234018715767716,0.332340187157677,-0.7953300858899103,1.0153300858899106,-0.7953300858899103,1.0153300858899112,-0.27246951672795056,-0.30735804384501825,0.4775304832720493,0.0033021279348029804,-0.2724695167279506,-0.307358043845018,0.4775304832720497,0.0033021279348030984],"b_label":"y features","labels":["A4","D4","D3a","D3b","D20","D21","D22","D23","D10","D11","D12","D13","D14","D15","D16","D17"],"marker":15}},{"phase":2,"caption":"Accumulate squared differences, then take the square root.","panel":{"kind":"bars","title":"Squared coordinate differences","a":[0.022499999999999905],"a_label":"contributions","labels":["A4"],"marker":0},"value":0.1499999999999997,"value_label":"partial distance"},{"phase":2,"caption":"Accumulate squared differences, then take the square root.","panel":{"kind":"bars","title":"Squared coordinate differences","a":[0.022499999999999905,0.0209488586801816,0.7290636400838172,0.7290636400838186],"a_label":"contributions","labels":["A4","D4","D3a","D3b"],"marker":3},"value":1.22538815844116,"value_label":"partial distance"},{"phase":2,"caption":"Accumulate squared differences, then take the square root.","panel":{"kind":"bars","title":"Squared coordinate differences","a":[0.022499999999999905,0.0209488586801816,0.7290636400838172,0.7290636400838186,0.1899701691877942,0.5785015295724796,0.022520191970228913],"a_label":"contributions","labels":["A4","D4","D3a","D3b","D20","D21","D22"],"marker":6},"value":1.5141228581519797,"value_label":"partial distance"},{"phase":2,"caption":"Accumulate squared differences, then take the square root.","panel":{"kind":"bars","title":"Squared coordinate differences","a":[0.022499999999999905,0.0209488586801816,0.7290636400838172,0.7290636400838186,0.1899701691877942,0.5785015295724796,0.022520191970228913,0.22543931042586807,0.12083115355002018,0.10476671746803377],"a_label":"contributions","labels":["A4","D4","D3a","D3b","D20","D21","D22","D23","D10","D11"],"marker":9},"value":1.656383171558514,"value_label":"partial distance"},{"phase":2,"caption":"Accumulate squared differences, then take the square root.","panel":{"kind":"bars","title":"Squared coordinate differences","a":[0.022499999999999905,0.0209488586801816,0.7290636400838172,0.7290636400838186,0.1899701691877942,0.5785015295724796,0.022520191970228913,0.22543931042586807,0.12083115355002018,0.10476671746803377,0.04266622776151119,0.12943841465646472,0.12083115355002007],"a_label":"contributions","labels":["A4","D4","D3a","D3b","D20","D21","D22","D23","D10","D11","D12","D13","D14"],"marker":12},"value":1.7425673608185819,"value_label":"partial distance"},{"phase":2,"caption":"Accumulate squared differences, then take the square root.","panel":{"kind":"bars","title":"Squared coordinate differences","a":[0.022499999999999905,0.0209488586801816,0.7290636400838172,0.7290636400838186,0.1899701691877942,0.5785015295724796,0.022520191970228913,0.22543931042586807,0.12083115355002018,0.10476671746803377,0.04266622776151119,0.12943841465646472,0.12083115355002007,0.5297549661886911,0.03904882609468467,0.12943841465646364],"a_label":"contributions","labels":["A4","D4","D3a","D3b","D20","D21","D22","D23","D10","D11","D12","D13","D14","D15","D16","D17"],"marker":15},"value":1.9325587219875306,"value_label":"partial distance"},{"phase":3,"caption":"Read the completed comparison using every retained coordinate.","panel":{"kind":"bars","title":"Squared coordinate differences","a":[0.022499999999999905,0.0209488586801816,0.7290636400838172,0.7290636400838186,0.1899701691877942,0.5785015295724796,0.022520191970228913,0.22543931042586807,0.12083115355002018,0.10476671746803377,0.04266622776151119,0.12943841465646472,0.12083115355002007,0.5297549661886911,0.03904882609468467,0.12943841465646364],"a_label":"contributions","labels":["A4","D4","D3a","D3b","D20","D21","D22","D23","D10","D11","D12","D13","D14","D15","D16","D17"],"marker":0},"value":1.9325587219875306,"value_label":"final distance"},{"phase":3,"caption":"Read the completed comparison using every retained coordinate.","panel":{"kind":"bars","title":"Squared coordinate differences","a":[0.022499999999999905,0.0209488586801816,0.7290636400838172,0.7290636400838186,0.1899701691877942,0.5785015295724796,0.022520191970228913,0.22543931042586807,0.12083115355002018,0.10476671746803377,0.04266622776151119,0.12943841465646472,0.12083115355002007,0.5297549661886911,0.03904882609468467,0.12943841465646364],"a_label":"contributions","labels":["A4","D4","D3a","D3b","D20","D21","D22","D23","D10","D11","D12","D13","D14","D15","D16","D17"],"marker":5},"value":1.9325587219875306,"value_label":"final distance"},{"phase":3,"caption":"Read the completed comparison using every retained coordinate.","panel":{"kind":"bars","title":"Squared coordinate differences","a":[0.022499999999999905,0.0209488586801816,0.7290636400838172,0.7290636400838186,0.1899701691877942,0.5785015295724796,0.022520191970228913,0.22543931042586807,0.12083115355002018,0.10476671746803377,0.04266622776151119,0.12943841465646472,0.12083115355002007,0.5297549661886911,0.03904882609468467,0.12943841465646364],"a_label":"contributions","labels":["A4","D4","D3a","D3b","D20","D21","D22","D23","D10","D11","D12","D13","D14","D15","D16","D17"],"marker":10},"value":1.9325587219875306,"value_label":"final distance"},{"phase":3,"caption":"Read the completed comparison using every retained coordinate.","panel":{"kind":"bars","title":"Squared coordinate differences","a":[0.022499999999999905,0.0209488586801816,0.7290636400838172,0.7290636400838186,0.1899701691877942,0.5785015295724796,0.022520191970228913,0.22543931042586807,0.12083115355002018,0.10476671746803377,0.04266622776151119,0.12943841465646472,0.12083115355002007,0.5297549661886911,0.03904882609468467,0.12943841465646364],"a_label":"contributions","labels":["A4","D4","D3a","D3b","D20","D21","D22","D23","D10","D11","D12","D13","D14","D15","D16","D17"],"marker":15},"value":1.9325587219875306,"value_label":"final distance"}],"checks":{"api":"orthonormal Haar identity","expected":1.932558721987531,"observed":1.9325587219875306,"tolerance":1e-12},"echotime_status":"Possible addition","echotime_api":""}
