- #1

samdunhamss

- 10

- 0

## Homework Statement

I'm working on a Lab for my Electronics Course and need to use MATLAB to create a Bode Plot to get the data for my theoretical Magnitudes at frequencies between 50Hz and 500 Hz. The Resistor has a value of 1k and the Capacitor has a value of 1uF.

I need one for both a high and low pass filter.

## Homework Equations

I believe the transfer functions are

H= 1/(s*RC + 1) for the lowpass

and

H= s*RC/(RC*s+1)

## The Attempt at a Solution

The MATLAB code I use

s=tf('s');

RC = .000001*1000;

H=1/(RC*s+1);

h=s*RC/(1+RC*s);

W=[50:50:500];

[MAG,PHASE] = bode(H,W);

[MAG,PHASE] = bode(h,W);

Now these are done in real time, not in a .m file.

The problem is that the values are nothing what I expected. When I mess around with the circuit in Transient Analysis in LTSPICE I get values close to what I need, but not in a convenient list form like I would prefer. I think my problems in MATLAB arise somewhere in my transfer functions.

If it's of any consequence the input signal is a simple sine wave with an amplitude of 1V.