# Hidden Markov Model: How to define the state observation matrix B for continuous (Normal) observations?

I am having a hard time understanding how to use the observation matrix B for continuous HMM assuming the observation of each hidden state Normal.

So far I defined the matrix B as an Nx2 matrix where N is the number of states and 2 is mean and variance of the Normal dist. Question 1: is this correct?

Now, I want to use the values inside the matrix B in the forward algorithm (let's call b the terms inside the matrix B). The forward algorithm I am referring is the following one:

In particular, in step (b), I have to multiply the bracket by bj(Ot) and I am not sure how to define it.

Online I found the following definition in terms of pdf:

Question 2: Is this formula correct to be used in the forward alg.? In this formula I know the mean and variance for each hidden state that are contained in the matrix B. By the way, I do not know how to define Ot. In fact, my initial idea was to use the single observation at time t. By the way, knowing that the continuous pdf of a single number is 0, this makes no sense. Question 3: Am I missing something? How can I formulate this?

Thank you so much in advance!

Question 2 and 3: $$o_t$$ is your observation, the realization of your observed random variable. In case of continuous observations it is then a scalar. Yes, the formula of the gaussian density function is the correct formula to plug in your observations. It is the quantity to be used in the forward-backward algorithm. It is not $$0$$ as you will see when you will implement the algorithm. This density has to be thought as a likelihood of the observations which gives a score at seeing this observation, not a probability in the strict sense.