I want to graph a yield curve using the yield to maturity of my bonds. However, my coupon rates have different periodicities. Financial Mathematics for Actuaries by Wai-Sum Chan Yiu-Kuen Tse give the following formula for periodicity $2$.
$$ P=F r \sum_{j=1}^{2 n} \frac{1}{\left[1+\frac{i_{Y}}{2}\right]^{j}}+\frac{C}{\left[1+\frac{i_{Y}}{2}\right]^{2 n}} $$
Problem 1: What if the periodicity of the coupon payments is different than 2?
Problem 2: That formula would give a YTM convertible semianually. Then, I would have some annual effective YTM's and others would be conevrtible. How is that solved?