Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: UIT_ACM1602NI UIT_ADDA mbed
Revision 6:ccd700fb3f3a, committed 2014-12-08
- Comitter:
- MikamiUitOpen
- Date:
- Mon Dec 08 05:47:04 2014 +0000
- Parent:
- 5:9dd178ff6239
- Commit message:
- 7
Changed in this revision
| WindowingDesignLpfHpf/WindowingDesignLH.cpp | Show annotated file Show diff for this revision Revisions of this file |
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/WindowingDesignLpfHpf/WindowingDesignLH.cpp Sun Dec 07 08:55:48 2014 +0000
+++ b/WindowingDesignLpfHpf/WindowingDesignLH.cpp Mon Dec 08 05:47:04 2014 +0000
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// Design of FIR filter of LPF and HPF using window method
//
-// 2014/11/09, Copyright (c) 2014 MIKAMI, Naoki
+// 2014/12/08, Copyright (c) 2014 MIKAMI, Naoki
//------------------------------------------------------------------------------
#include "WindowingDesignLH.hpp"
@@ -46,23 +46,6 @@
for (int k=0; k<=order/2; k++)
hk[k] = hm_[order/2-k];
-
- // For compensation of gain
- float sum = hk[order_/2];
- if (pb == LPF)
- for (int k=0; k<order_/2; k++)
- sum = sum + 2.0f*hk[k];
- if (pb == HPF)
- {
- float sign = -1.0;
- for (int k=order_/2-1; k>=0; k--)
- {
- sum = sum + sign*2.0f*hk[k];
- sign = -sign;
- }
- }
- for (int k=0; k<=order_/2; k++)
- hk[k] = hk[k]/sum;
}
// Calculation of coefficients for LPF
--- a/main.cpp Sun Dec 07 08:55:48 2014 +0000
+++ b/main.cpp Mon Dec 08 05:47:04 2014 +0000
@@ -3,7 +3,7 @@
// A0: Signal to be filtered
// A2: Value which controls cutoff frequency
//
-// 2014/12/07, Copyright (c) 2014 MIKAMI, Naoki
+// 2014/12/08, Copyright (c) 2014 MIKAMI, Naoki
//------------------------------------------------------------------
#include "mbed.h"
@@ -104,3 +104,4 @@
wait(0.1f);
}
}
+