{ "info": { "author": "Felix Musmann", "author_email": "felix.musmann@student.hpi.de", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy" ], "description": "\n# Jointly: Signal Synchronizer\n\n## The Syncing Process\n\nTo sync two sources with each other, they need a simultaneously recorded signal with a characteristic signature at two timepoints in common. This could be the magnitude of the accelerometer for example, if multiple devices are shaken together.\n\n### Selecting common segments\n\nThe script can detect prominent shakes automatically with the `ShakeExtractor`. This is done by detecting the peaks above a certain `threshold`. They are then merged to sequences, if two peaks are not farther apart than a specified `distance` in milliseconds. Sequences with less than `min_length` peaks are filtered out. Sequences, that do not start or end in a `window` of seconds from start and end of the signal respectivley, are filtered in a second step. From these filtered sequences the sequence with the highest weight (mean + median of sequence) is selected for the corresponding segment.\n\n### Calculation of the timeshift\n\nTo compensate the differences in the system time of different sources, the timeshift to synchronize the selected segments with each other is calculated. For the automatic computation of the timeshift between two signals the cross-correlation for each segment with the reference signal is calculated. The signals are shifted so that the correlation between the selected segments is maximized.\n\n### Adjusting the frequency\n\nDue to clock drift, which denotes the issue that a clock is not running at the exact same frequency as a specified reference clock, signals that can be in sync at one timepoint desynchronize gradually over time. To compensate this effect a stretching factor is calculated, which brings the difference between the timeshifts for the synchronization based on the first and second segment respectively to zero. After stretching the signal, the timeshift to align the signals has to be calculated again.\n\n## Example\n\n### Syncing data\n\nThe data has to be provided in pandas `DataFrame` with a `DateTimeIndex`.\n\n```python\nimport jointly\n\nsources = {\n 'Faros': {\n 'data': faros.data,\n 'ref_column': 'acc_mag',\n },\n 'Empatica': {\n 'data': empatica.data,\n 'ref_column': 'acc_mag',\n },\n 'Everion': {\n 'data': everion.data,\n 'ref_column': 'acc_mag',\n }\n}\nref_source_name = 'Empatica'\n\nextractor = jointly.ShakeExtractor()\nsynchronizer = jointly.Synchronizer(sources, ref_source_name, extractor)\nsynced_data = synchronizer.get_synced_data()\n```\n\n### Saving data\n\nTo define the tables, which should be saved, create a dictionary. Every key at root level defines the name of the corresponding file. The dictionary at the second level defines a list of columns, which should be saved in this file, for each source. The `save_data()` method will also automatically save all data from all sources in a file named `TOTAL.csv`. This can be deactivated by adding the argument `save_total_table = False`.\n\n```python\ntables = {\n 'ACC': {\n 'Faros': ['Accelerometer_X', 'Accelerometer_Y', 'Accelerometer_Z'],\n 'Empatica': ['acc_x', 'acc_y', 'acc_z'],\n 'Everion': ['accx_data', 'accy_data', 'accz_data'],\n },\n 'PPG': {\n 'Empatica': ['bvp'],\n 'Everion': ['blood_pulse_wave', 'led2_data', 'led3_data'],\n },\n 'EDA': {\n 'Empatica': ['eda'],\n 'Everion': ['gsr_electrode'],\n },\n 'ECG': {\n 'Faros': ['ECG'],\n },\n 'TEMP': {\n 'Empatica': ['temp'],\n 'Everion': ['temperature_object'],\n },\n 'HR': {\n 'Empatica': ['hr'],\n 'Everion': ['heart_rate', 'heart_rate_quality'],\n }, \n 'IBI': {\n 'Faros': ['HRV'],\n 'Empatica': ['ibi'],\n 'Everion': ['inter_pulse_interval', 'inter_pulse_interval_deviation'],\n }\n}\n\nsynchronizer.save_data(sync_dir_path, tables=tables)\n```\n\n## Logging\n\nTo activate logging simply add the following lines to your code:\n\n```python\nfrom jointly.log import logger\nlogger.setLevel(10)\n```\n\nThis will give you insight into the shake detection, calculation of the timeshifts and stretching factor, and output plots of the segements.\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "Jointly", "package_url": "https://pypi.org/project/Jointly/", "platform": "", "project_url": "https://pypi.org/project/Jointly/", "project_urls": null, "release_url": "https://pypi.org/project/Jointly/0.1.5/", "requires_dist": [ "matplotlib", "numpy", "pandas", "scipy" ], "requires_python": ">=3.6.0", "summary": "Synchronize multiple signals from different sources.", "version": "0.1.5" }, "last_serial": 5879444, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "e95ed623a36f5e196a86cccb352e6c6c", "sha256": "fb694a22ec28c10838b5f3aad74e90a6417c21c3abdc71e7932665024ee97e25" }, "downloads": -1, "filename": "Jointly-0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "e95ed623a36f5e196a86cccb352e6c6c", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6.0", "size": 11586, "upload_time": "2019-05-09T13:45:44", "url": "https://files.pythonhosted.org/packages/cc/b5/07bdf4f569b29380b2b7457a2720435af80ea2aa0bbf7f48c27158a2e469/Jointly-0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9cf13f8d0f5819bcbe06a702a831f652", "sha256": "3c896a4c6bc46c8c4ee29018ce270e3472fe8019f906bc1bea9505999605246a" }, "downloads": -1, "filename": "Jointly-0.1.tar.gz", "has_sig": false, "md5_digest": "9cf13f8d0f5819bcbe06a702a831f652", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6.0", "size": 10387, "upload_time": "2019-05-09T13:45:46", "url": "https://files.pythonhosted.org/packages/1d/92/a570cbc72793c354c8b02ced14d184f22171eab8f684c659220d491b752f/Jointly-0.1.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "a70ab005bce98874872e001ec49b48b7", "sha256": "daf010a30debbced0c7d1b354465453de0906287d453c37d1b90f5e79f9918bb" }, "downloads": -1, "filename": "Jointly-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "a70ab005bce98874872e001ec49b48b7", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6.0", "size": 11356, "upload_time": "2019-05-16T10:34:15", "url": "https://files.pythonhosted.org/packages/c9/c3/d16b018026fb44843f22564cffb7299689746b10251867c8d35592a320a0/Jointly-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9f66ae8e987775b0b198e21ba4f2905c", "sha256": "79213003b9f100e3e27bccedd2645a739e5d982735693721c916e0799d03a408" }, "downloads": -1, "filename": "Jointly-0.1.1.tar.gz", "has_sig": false, "md5_digest": "9f66ae8e987775b0b198e21ba4f2905c", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6.0", "size": 10055, "upload_time": "2019-05-16T10:34:16", "url": "https://files.pythonhosted.org/packages/43/a3/fa89190529df14a637088f6b47af03af1b207fa52302a613c4049e8917ae/Jointly-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "f93e38af5b4ded351b9fa08f909ea47c", "sha256": "d61b66ade163a82535741dafa539efefd92dcbf4ae874651557c69a36603ea37" }, "downloads": -1, "filename": "Jointly-0.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "f93e38af5b4ded351b9fa08f909ea47c", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6.0", "size": 11728, "upload_time": "2019-08-26T14:10:08", "url": "https://files.pythonhosted.org/packages/c7/e4/792f97a89c045799ba40a6bd49d18dc4c46a8ed0d3c86c57c342b01c3909/Jointly-0.1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8a0748b2d2404e982bb0983600304fc6", "sha256": "5c0a9f275a661c83aac40acfe32f95029cec270fd67ebacf6ddf467451dd59b4" }, "downloads": -1, "filename": "Jointly-0.1.2.tar.gz", "has_sig": false, "md5_digest": "8a0748b2d2404e982bb0983600304fc6", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6.0", "size": 10061, "upload_time": "2019-08-26T14:10:10", "url": "https://files.pythonhosted.org/packages/34/9d/a32d550597a064f7bc885fffc12c80f6e97d81057ecf81ec1389df18dd1a/Jointly-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "70751e2739baf17ee6a8c139bdb3ded3", "sha256": "2746c3af63526562577642bc0e887049c60384f5336b05e3fd0cbcfed4a1537f" }, "downloads": -1, "filename": "Jointly-0.1.3-py3-none-any.whl", "has_sig": false, "md5_digest": "70751e2739baf17ee6a8c139bdb3ded3", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6.0", "size": 11824, "upload_time": "2019-09-10T15:51:29", "url": "https://files.pythonhosted.org/packages/2d/3c/12fb82a303a5aa98a2d56e868047a6143632e3a5bfae316a4ff10e204c48/Jointly-0.1.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0558dc2a3ccc703567a5ed55ddef37cd", "sha256": "5b1fba6abc926655144750395ad33fcb63e3d2046fa23b96637a0bd3a47aaf94" }, "downloads": -1, "filename": "Jointly-0.1.3.tar.gz", "has_sig": false, "md5_digest": "0558dc2a3ccc703567a5ed55ddef37cd", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6.0", "size": 10152, "upload_time": "2019-09-10T15:51:32", "url": "https://files.pythonhosted.org/packages/41/f7/3d0c9cbc2697b91dc65f02eee21f38b1e3a8f24e895ce3a4184549829a46/Jointly-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "02ac6e34cdfe1d441e9756535de87928", "sha256": "5093c3a031b0068d9dbc226d7225a945b15feaa5b7bc79964572e1245fe4b31f" }, "downloads": -1, "filename": "Jointly-0.1.4-py3-none-any.whl", "has_sig": false, "md5_digest": "02ac6e34cdfe1d441e9756535de87928", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6.0", "size": 11865, "upload_time": "2019-09-13T12:37:15", "url": "https://files.pythonhosted.org/packages/6d/ec/10ac0cd7c21e58a907f7eb69ae8bd66111dd6fb5c7148f23d8e30356b036/Jointly-0.1.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "df7df4f9e88c84491c19b1b17843bd7e", "sha256": "13840d71b041119420e3ac338efcec663ba4578a835c9b9de87c92c2495130a9" }, "downloads": -1, "filename": "Jointly-0.1.4.tar.gz", "has_sig": false, "md5_digest": "df7df4f9e88c84491c19b1b17843bd7e", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6.0", "size": 10181, "upload_time": "2019-09-13T12:37:19", "url": "https://files.pythonhosted.org/packages/dc/dd/d95641c83d31298d710f0b3f8265efabf6ef371262c0b560c73c7aa0643c/Jointly-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "4f2d13c8caa200562c4a72cbcbddb22b", "sha256": "4eb57840c873b63d624560a7c1c2574e66c7bb76fafcd7cd1c7f61a0fd3796d1" }, "downloads": -1, "filename": "Jointly-0.1.5-py3-none-any.whl", "has_sig": false, "md5_digest": "4f2d13c8caa200562c4a72cbcbddb22b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6.0", "size": 11815, "upload_time": "2019-09-24T12:34:54", "url": "https://files.pythonhosted.org/packages/7f/49/a3df01d1b32724020f48e709f157dfbab4c4246b7c0af6c2dc0bb1cdee40/Jointly-0.1.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c618946117980c97285ee43628e459d3", "sha256": "eb62f7684746f8547728fefe6f3121a7c97439306a6901e70f57ed693cb1e5be" }, "downloads": -1, "filename": "Jointly-0.1.5.tar.gz", "has_sig": false, "md5_digest": "c618946117980c97285ee43628e459d3", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6.0", "size": 10138, "upload_time": "2019-09-24T12:34:56", "url": "https://files.pythonhosted.org/packages/52/1a/45966aa60ea3b78ce126bf6286e1672db2d50015577b8476fd29a12114a8/Jointly-0.1.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "4f2d13c8caa200562c4a72cbcbddb22b", "sha256": "4eb57840c873b63d624560a7c1c2574e66c7bb76fafcd7cd1c7f61a0fd3796d1" }, "downloads": -1, "filename": "Jointly-0.1.5-py3-none-any.whl", "has_sig": false, "md5_digest": "4f2d13c8caa200562c4a72cbcbddb22b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.6.0", "size": 11815, "upload_time": "2019-09-24T12:34:54", "url": "https://files.pythonhosted.org/packages/7f/49/a3df01d1b32724020f48e709f157dfbab4c4246b7c0af6c2dc0bb1cdee40/Jointly-0.1.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c618946117980c97285ee43628e459d3", "sha256": "eb62f7684746f8547728fefe6f3121a7c97439306a6901e70f57ed693cb1e5be" }, "downloads": -1, "filename": "Jointly-0.1.5.tar.gz", "has_sig": false, "md5_digest": "c618946117980c97285ee43628e459d3", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6.0", "size": 10138, "upload_time": "2019-09-24T12:34:56", "url": "https://files.pythonhosted.org/packages/52/1a/45966aa60ea3b78ce126bf6286e1672db2d50015577b8476fd29a12114a8/Jointly-0.1.5.tar.gz" } ] }