Found out I was Pregnant...Graphic..

I found out I was pregnant ,, I’m sure I should be about 4 weeks .. so I started getting these cramps and brown discharge started coming out and I looked it up it said it was normal .. so it happened for a week and today I woke up with the same cramps but this time when I went to use the restroom I had red mucus come out .. and since the morning every time I wipe there’s blood .. did I have a miscarriage.?