Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
A

ashwiny

@ashwiny
About
Posts
26
Topics
10
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • please explain how it works
    A ashwiny

    could anyone tell me briefly how this code is working?please help me. // nonrec_t.spc -- test program for non-recursive filter design #include "tools.h" #include "ltisys.h" #include "nonrec.h" int main() { Graph gr(3,2,"Non-Recursive Filter Design"); // calculate low-pass filter and plot LTISystem lp = NRLowPass(0.1,63); lp.a.plot(gr,1,"Low-pass at 0.1","Samples","Amp"); // calculate frequency response and plot Spectrum lpf(500,1000); for (int i=0;i<500;i++) lpf[i] = lp.response(i/1000.0); lpf.plotLogMag(gr,2,"Frequency Response"); // calculate high-pass filter and plot LTISystem hp = NRHighPass(0.4,63); hp.a.plot(gr,3,"High-pass at 0.4","Samples","Amp"); // calculate frequency response and plot Spectrum hpf(500,1000); for (int i=0;i<500;i++) hpf[i] = hp.response(i/1000.0); hpf.plotLogMag(gr,4,"Frequency Response"); // calculate band-pass filter and plot LTISystem bp = NRBandPass(0.2,0.3,63); bp.a.plot(gr,5,"Band-pass at 0.2-0.3","Samples","Amp"); // calculate frequency response and plot Spectrum bpf(500,1000); for (int i=0;i<500;i++) bpf[i] = bp.response(i/1000.0); bpf.plotLogMag(gr,6,"Frequency Response"); gr.close(); } // kaiser_t.cpp -- test program for Kaiser window design #include "tools.h" #include "ltisys.h" #include "nonrec.h" #include "kaiser.h" const int MAXKAISERWIN=256; // maximum window length // Create non-recursive low-pass filter using Kaiser window LTISystem KaiserLowPass( double freq, // corner freq // (fraction of sampling rate) double ripple, // allowed ripple (dB) double twidth // transition width // (fraction of sampling rate) } ) // returns LTI System { int i; // get (half-)Kaiser window Waveform kwin = Kaiser(ripple,twidth,MAXKAISERWIN); int nhalf = kwin.count()-1; // generate one half of coefficients from // windowed sinc() function double omega = 2*PI*freq; for (i=0;i<=nhalf;i++) kwin[i+1] *= omega*sinc(i*omega)/PI; // copy into LT

    C / C++ / MFC c++ database design data-structures tools

  • [Message Deleted]
    A ashwiny

    actually i got repost the question again sir

    C / C++ / MFC

  • c++ to matlab
    A ashwiny

    hello everyone, i need to call my coding in c++ to matlab..it's about filter..i got read some materials about calling c++ to matlab but im not that understood..i dont know where to start and dont have clear view..i need some guidance..thank you

    C / C++ / MFC c++

  • C++ to mathlab
    A ashwiny

    yes sir

    C / C++ / MFC tutorial c++

  • C++ to mathlab
    A ashwiny

    hello everyone, i need to call my coding in C++ to mathlab..i have read some materials for it but i still couldnt get a clear view.really dont know how to start it..hope you all can guide me..thank you.

    C / C++ / MFC tutorial c++

  • C++ to mathlab
    A ashwiny

    hello veryone, how to call coding in C++ to mathlab?

    C / C++ / MFC c++ tutorial question

  • [Message Deleted]
    A ashwiny

    [Message Deleted]

    C / C++ / MFC

  • error in filter design coding
    A ashwiny

    thank you sir.now i can run the code.

    C / C++ / MFC help c++ design

  • error in filter design coding
    A ashwiny

    so what shall i do now sir?im kind of blur.

    C / C++ / MFC help c++ design

  • error in filter design coding
    A ashwiny

    hello everyone, i need help to fix these errors..when i tried to fix it im getting more errors..please help me. #ifndef _Convert_h #define _Convert_h Waveform SignalToWaveform(const Signal& s); Signal WaveformToSignal(const Waveform& w); ComplexWaveform WaveformToComplexWaveform(const Waveform& w); Waveform ComplexWaveformMagToWaveform(const ComplexWaveform& c); Waveform ComplexWaveformRealToWaveform(const ComplexWaveform& c); #endif 3.cpp c:\vc98\include\convert.h(4) : error C2143: syntax error : missing ',' before '&' c:\vc98\include\convert.h(4) : error C2059: syntax error : '&' c:\vc98\include\convert.h(5) : error C2146: syntax error : missing ';' before identifier 'WaveformToSignal' c:\vc98\include\convert.h(5) : error C2501: 'Signal' : missing storage-class or type specifiers c:\vc98\include\convert.h(5) : fatal error C1004: unexpected end of file found Error executing cl.exe. 3.exe - 5 error(s), 0 warning(s)

    C / C++ / MFC help c++ design

  • could anyone tell me what's the error with this code?
    A ashwiny

    im getting the same error..fatal error C1083: Cannot open include file: 'tools.h': No such file or directory

    C / C++ / MFC c++ design tools help question

  • could anyone tell me what's the error with this code?
    A ashwiny

    i dont get you sir..how to change it?

    C / C++ / MFC c++ design tools help question

  • could anyone tell me what's the error with this code?
    A ashwiny

    yes it is there sir.

    C / C++ / MFC c++ design tools help question

  • could anyone tell me what's the error with this code?
    A ashwiny

    am using Visual c++ 6.0

    C / C++ / MFC c++ design tools help question

  • could anyone tell me what's the error with this code?
    A ashwiny

    i have tried but cannot sir

    C / C++ / MFC c++ design tools help question

  • could anyone tell me what's the error with this code?
    A ashwiny

    yes sir..still getting the same error

    C / C++ / MFC c++ design tools help question

  • could anyone tell me what's the error with this code?
    A ashwiny

    sir i followed as you said but im still getting the same error.

    C / C++ / MFC c++ design tools help question

  • could anyone tell me what's the error with this code?
    A ashwiny

    Actually the coding is to design a low pass filter to remove ecg signal noise..the coding was given my lecture for the project..when I tried to run it i got this error. ‘fatal error C1083: Cannot open include file: 'tools.h': No such file or directory’

    C / C++ / MFC c++ design tools help question

  • could anyone tell me what's the error with this code?
    A ashwiny

    // nonrec.cpp -- non-recursive filter design // NRLowPass() build NR low-pass filter // NRHighPass() build NR high-pass filter // NRBandPass() build NR band-pass filter #include "tools.h" #include "ltisys.h" // sinc() or sin(x)/x function double sinc(double x) { if (x==0) return cos(x); else return sin(x)/x; } // Create non-recursive low-pass filter by Fourier Transform method LTISystem NRLowPass( double freq, // corner freq (fraction of sampling rate) int ncoeff // # coefficients ) // returns LTI system to specification { int i; // convert frequency double omega = 2 * PI * freq; // build half-sized window from sinc function int nhalf = ncoeff/2; Waveform hwv(nhalf,1.0); for (i=1;i<=nhalf;i++) hwv[i] = omega * sinc(i*omega)/PI; // window with (half-)hamming window for (i=1;i<=nhalf;i++) hwv[i] *= 0.54 + 0.46 * cos(i*PI/nhalf); // create new LTI System LTISystem lpfilt(2*nhalf,0); // copy impulse response into system // (indexed -nhalf .. 0 .. nhalf) lpfilt.a[nhalf] = omega/PI; for (i=1;i<=nhalf;i++) { lpfilt.a[nhalf-i] = hwv[i]; lpfilt.a[nhalf+i] = hwv[i]; } return lpfilt; } // create high-pass non-recursive filter from low-pass prototype LTISystem NRHighPass( double freq, // corner freq (fraction of sampling rate) int ncoeff // # coefficients ) // returns LTI system { // get low-pass version LTISystem hpfilt = NRLowPass(0.5-freq,ncoeff); // now modulate with cos(n*PI) = +1,-1,+1,-1,... int nhalf = hpfilt.a.count()/2; for (int i=1;i<=nhalf;i+=2) { hpfilt.a[nhalf-i] = -hpfilt.a[nhalf-i]; hpfilt.a[nhalf+i] = -hpfilt.a[nhalf+i]; } return hpfilt; } // create band-pass non-recursive filter from low-pass prototype LTISystem NRBandPass( double lofreq, // low corner freq (fraction of sampling rate) double hifreq, // high corner freq (fraction of sampling rate) } int ncoeff // # coefficients ) // returns LTI system { // get low-pass prototype LTISystem bpfilt = NRLowPass((hifreq-lofreq)/2,ncoeff); // now modulate with cos(n*centrefreq) int nhalf = bpfilt.a.count()/2; double cf = 2*PI*(lofreq+hifreq)/2; bpfilt.a[nhalf] = 2 * bpfilt.a[nhalf]; for (int i=1;i<=nhalf;i++) { bpfilt.a[nhalf-i] = 2 * bpfilt.a[nhalf-i] * cos(i*cf); bpfilt.a[nhalf+i] = 2 * bpfilt.a[nhalf+i] * cos(i*cf); } return bpfilt; }

    C / C++ / MFC c++ design tools help question

  • source code to eliminate power line noise frm ECG signal
    A ashwiny

    hi, can i draw a circuit in matlab? ashwiny

    C# help
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups