Received: from PCH.mit.edu (18.7.21.50) by mail.efplus.com (192.168.0.8) with Microsoft SMTP Server (TLS) id 8.3.485.1; Tue, 11 Aug 2020 09:10:11 -0700 Received: from PCH.MIT.EDU (localhost.localdomain [127.0.0.1]) by PCH.mit.edu (8.14.7/8.12.8) with ESMTP id 07BFxYoR031032; Tue, 11 Aug 2020 12:00:07 -0400 Received: from outgoing-exchange-3.mit.edu (OUTGOING-EXCHANGE-3.MIT.EDU [18.9.28.13]) by PCH.mit.edu (8.14.7/8.12.8) with ESMTP id 07BFxXpE031028 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 11 Aug 2020 11:59:33 -0400 Received: from w92exedge4.exchange.mit.edu (W92EXEDGE4.EXCHANGE.MIT.EDU [18.7.73.16]) by outgoing-exchange-3.mit.edu (8.14.7/8.12.4) with ESMTP id 07BG1JIY026020 for ; Tue, 11 Aug 2020 12:01:42 -0400 Received: from w92expo22.exchange.mit.edu (18.7.74.76) by w92exedge4.exchange.mit.edu (18.7.73.16) with Microsoft SMTP Server (TLS) id 15.0.1293.2; Tue, 11 Aug 2020 11:58:21 -0400 Received: from oc11exhyb8.exchange.mit.edu (18.9.1.113) by w92expo22.exchange.mit.edu (18.7.74.76) with Microsoft SMTP Server (TLS) id 15.0.1365.1; Tue, 11 Aug 2020 11:59:15 -0400 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.170) by oc11exhyb8.exchange.mit.edu (18.9.1.113) with Microsoft SMTP Server (TLS) id 15.0.1395.4 via Frontend Transport; Tue, 11 Aug 2020 11:59:15 -0400 Received: from MWHPR18CA0033.namprd18.prod.outlook.com (2603:10b6:320:31::19) by DM6PR01MB5273.prod.exchangelabs.com (2603:10b6:5:6d::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3261.22; Tue, 11 Aug 2020 15:59:14 +0000 Received: from CO1NAM03FT055.eop-NAM03.prod.protection.outlook.com (2603:10b6:320:31:cafe::14) by MWHPR18CA0033.outlook.office365.com (2603:10b6:320:31::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3261.19 via Frontend Transport; Tue, 11 Aug 2020 15:59:13 +0000 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (40.107.92.129) by CO1NAM03FT055.mail.protection.outlook.com (10.152.81.162) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3261.16 via Frontend Transport; Tue, 11 Aug 2020 15:59:13 +0000 Received: from CY4PR01MB2407.prod.exchangelabs.com (2603:10b6:903:6d::17) by CY4PR0101MB3013.prod.exchangelabs.com (2603:10b6:910:47::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3261.22; Tue, 11 Aug 2020 15:59:10 +0000 Received: from CY4PR01MB2407.prod.exchangelabs.com ([fe80::3012:6a60:1804:c5a4]) by CY4PR01MB2407.prod.exchangelabs.com ([fe80::3012:6a60:1804:c5a4%12]) with mapi id 15.20.3261.024; Tue, 11 Aug 2020 15:59:09 +0000 From: David Van Horn To: Microcontroller discussion list - Public. Sender: "piclist-bounces@mit.edu" Date: Tue, 11 Aug 2020 08:59:09 -0700 Subject: Re: [EE] averaging multiple samples to reject AC interference Thread-Topic: [EE] averaging multiple samples to reject AC interference Thread-Index: AQHWb1NjPPoZ8HQTjUyohtCOWIFSLqkxzI0AgAFFIWs= Message-ID: References: <20200810131708.06a56fd6300ec2bfca6379d4e10ab8d2.bc322fe198.wbe@email27.godaddy.com>, List-Help: List-Subscribe: , List-Unsubscribe: , In-Reply-To: Reply-To: Microcontroller discussion list - Public. Accept-Language: en-US Content-Language: en-US X-MS-Exchange-Organization-AuthAs: Anonymous X-MS-Exchange-Organization-AuthSource: TS500.efplus4.local X-MS-Has-Attach: X-Auto-Response-Suppress: All X-MS-Exchange-Organization-SenderIdResult: Pass X-MS-Exchange-Organization-PRD: mit.edu X-MS-TNEF-Correlator: acceptlanguage: en-US received-spf: Pass (protection.outlook.com: domain of backcountryaccess.com designates 40.107.92.129 as permitted sender) receiver=protection.outlook.com; client-ip=40.107.92.129; helo=NAM10-BN7-obe.outbound.protection.outlook.com; dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=k2mdv.onmicrosoft.com; s=selector2-k2mdv-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=mQKk+5GPKUpLxEuiNo1b7WH+egZPGD56PNfc7BYESoU=; b=m5hx+UKoaDPvMBRuXeDdpeSoWXGG08WwcPsNMZ5bOHJDaJakLoFQDHD/uF+cHa0TxszBkDUFPr6URDadXIYTYc1/Tmupv56ATV9vfCFh1GiUHAMkRpuBQuDBFha+svFL3M/CxxmI+vo8PN+eVUVI5bGfSGQxR2PitNWhAb/C/5M= authentication-results: spf=pass (sender IP is 40.107.92.129) smtp.mailfrom=backcountryaccess.com; mit.edu; dkim=pass (signature was verified) header.d=k2mdv.onmicrosoft.com; mit.edu; dmarc=pass action=none header.from=backcountryaccess.com; x-originating-ip: [67.172.157.116] errors-to: piclist-bounces@mit.edu list-id: "Microcontroller discussion list - Public." list-post: x-beenthere: piclist@mit.edu x-mailman-version: 2.1.6 x-topics: [EE] x-content-filtered-by: Mailman/MimeDel 2.1.6 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 I did a filter some years back where I averaged up enough samples to get a = complete cycle of the AC line, inverted it, and added it back to the data, = which worked pretty well at getting rid of line based interference. ________________________________ From: piclist-bounces@mit.edu on behalf of Richar= d Prosser Sent: Monday, August 10, 2020 2:34 PM To: Microcontroller discussion list - Public. Subject: Re: [EE] averaging multiple samples to reject AC interference I did something similar a longish time ago - synchronised my sampling with the mains frequency & averaged over a full cycle. I can't remember the details but It worked well. I think I was using a Keithly meter as the adc and it handled the AC triggering side of things. RP On Tue, 11 Aug 2020 at 08:17, Jim wrote: > > > A .1 second worth of samples is 30 samples at a 1/300 sampling period. > > If my calculations are correct, 30 samples, at a 1/300 second sampling > period, that would reduce interference below about 5 Hz, if I am > thinking correctly about the Nyquist theory. > If the interference is low frequency, this method should provide some > degree of reduction. If the interference is higher frequency than that, > there may be little to no reduction. > The best way to find the answer is probably to just write the code to > implement the algorithm, and test it under actual conditions. > > Regards, > > Jim > > > -------- Original Message -------- > > Subject: [EE] averaging multiple samples to reject AC interference > > From: Bob Blick > > Date: Mon, August 10, 2020 2:44 pm > > To: "piclist@mit.edu" > > > > > > I have sensors that feed an instrumentation amplifier running a voltage > gain of 10 before going into the A/D converter of a microcontroller. > > > > There is AC line interference. It is small, but if I can reduce the > effect, that would be good. I'm in the 60 Hertz part of the world, but > ultimately this will be used in both 50Hz and 60Hz locations. Battery > operated, this is not conducted interference or power supply ripple. > Shielding is not possible. I only need to process the signal about 4 or 5 > times per second. The signal is changing, so long-term averaging is bad. > Actually any averaging will result in a tradeoff between response time an= d > accuracy that I will need to evaluate. > > > > These sensors are multiplexed with others and I can't sample > continuously. > > > > If I average multiple samples taken at 1/300 second intervals over a > 1/10 second period, that should give some improvement at 50Hz and 60Hz > without getting too involved, correct? This would fit into my existing > multiplexing constraints. > > > > I seem to recall being in this situation before but forget what I did a= t > the time. > > > > Thanks for any suggestions. > > Bob > > -- > > http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive > > View/change your membership options at > > http://mailman.mit.edu/mailman/listinfo/piclist > > -- > http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > -- http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .